Skip to content

Commit 0fd145e

Browse files
authored
Merge pull request #36 from stronk7/integration_test
Integration test & PHPCompatibility bump to develop#2fb82334
2 parents 805a077 + e9c8b17 commit 0fd145e

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.github/workflows/phpcs.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
php-version: ${{ matrix.php }}
2424
extensions: ${{ matrix.extensions }}
25-
ini-values: pcov.directory=moodle
25+
ini-values: pcov.directory=moodle, error_reporting=-1, display_errors=On
2626
coverage: pcov
2727
tools: composer
2828

@@ -46,3 +46,17 @@ jobs:
4646
4747
- name: Test coverage
4848
run: ./vendor/bin/phpunit-coverage-check -t 80 clover.xml
49+
50+
- name: Integration tests
51+
if: ${{ always() }}
52+
run: |
53+
# There is one failure (exit with error)
54+
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt || [[ $? = 1 ]]
55+
grep -q "PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY" output.txt
56+
57+
# The failure is fixed (exit with error)
58+
vendor/bin/phpcbf --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt || [[ $? = 1 ]]
59+
grep -q "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" output.txt
60+
61+
# So, there isn't any failure any more (exit without error)
62+
vendor/bin/phpcs --standard=moodle moodle/Tests/fixtures/integration_test_ci.php | tee output.txt && [[ $? = 0 ]]

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
],
1717
"require": {
1818
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
19-
"squizlabs/php_codesniffer": "^3.6",
20-
"phpcompatibility/php-compatibility": "^9.3"
19+
"squizlabs/php_codesniffer": "^3.7.1",
20+
"phpcompatibility/php-compatibility": "dev-develop#2fb82334"
2121
},
2222
"config": {
2323
"allow-plugins": {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
// phpcs:disable moodle.Files
3+
defined('MOODLE_INTERNAL') || die(); // Make this always the 1st line in all CS fixtures.
4+
$arr ['wrong'] = $value;

moodle/ruleset.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
4545

46+
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
47+
4648
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
4749
<rule ref="Squiz.Commenting.EmptyCatchComment"/>
4850

0 commit comments

Comments
 (0)