Skip to content

Commit bd2d185

Browse files
authored
Merge pull request #1173 from PHPCSStandards/phpcs-4.0/ghactions-end-to-end-should-also-run-on-4.x
4.0 | GH Actions/EndToEnd tests: fix the tests for 4.0
2 parents 7e89183 + 23bf79f commit bd2d185

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/end-to-end-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
push:
77
branches:
88
- master
9-
- 4.0
9+
- 4.x
1010
tags:
1111
- '**'
1212
paths-ignore:
@@ -27,7 +27,7 @@ jobs:
2727

2828
strategy:
2929
matrix:
30-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
30+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
3131

3232
# yamllint disable-line rule:line-length
3333
name: "E2E PHP: ${{ matrix.php }}"

tests/EndToEnd/phpcbf_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ function tear_down() {
55
}
66

77
function test_phpcbf_is_working() {
8-
OUTPUT="$(bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
8+
OUTPUT="$( { bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc; } 2>&1 )"
99

1010
assert_successful_code
1111
assert_contains "No violations were found" "$OUTPUT"
1212
}
1313

1414
function test_phpcbf_is_working_in_parallel() {
15-
OUTPUT="$(bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
15+
OUTPUT="$( { bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc; } 2>&1 )"
1616

1717
assert_successful_code
1818
assert_contains "No violations were found" "$OUTPUT"
1919
}
2020

2121
function test_phpcbf_returns_error_on_issues() {
22-
OUTPUT="$(bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
23-
assert_exit_code 1
22+
OUTPUT="$( { bin/phpcbf --no-colors --parallel=1 --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )"
23+
assert_successful_code
2424

2525
assert_contains "F 1 / 1 (100%)" "$OUTPUT"
2626
assert_contains "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" "$OUTPUT"

tests/EndToEnd/phpcs_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function test_phpcs_is_working_in_parallel() {
99
}
1010

1111
function test_phpcs_returns_error_on_issues() {
12-
OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
13-
assert_exit_code 2
12+
OUTPUT="$( { bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )"
13+
assert_exit_code 1
1414

1515
assert_contains "E 1 / 1 (100%)" "$OUTPUT"
1616
assert_contains "FOUND 1 ERROR AFFECTING 1 LINE" "$OUTPUT"

0 commit comments

Comments
 (0)