From 5eef585dd2dcabd26d9962447d2cddb7d51b9edc Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Aug 2025 15:43:48 +0200 Subject: [PATCH 1/5] GH Actions/end-to-end-tests: fix condition for running on pushes --- .github/workflows/end-to-end-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index ff9efd3729..a8c989eefb 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -6,7 +6,7 @@ on: push: branches: - master - - 4.0 + - 4.x tags: - '**' paths-ignore: From 1214258249a0229ff01b8d0d35d81a680392da1c Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Aug 2025 16:22:37 +0200 Subject: [PATCH 2/5] GH Actions/end-to-end-tests: remove unsupported PHP versions --- .github/workflows/end-to-end-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index a8c989eefb..ad05b65b90 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: - 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'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] # yamllint disable-line rule:line-length name: "E2E PHP: ${{ matrix.php }}" From d4586bff8676232d3d1d96bb796c2ecf43aff9e3 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Aug 2025 16:02:53 +0200 Subject: [PATCH 3/5] EndToEnd Tests: fix the code to allow for capturing both STDOUT as well as STERR As of PHPCS 4.0, the output is split between STDOUT and STDERR, so the tests need to capture the output of both streams to allow for the pre-existing assertions to pass. --- tests/EndToEnd/phpcbf_test.sh | 6 +++--- tests/EndToEnd/phpcs_test.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/EndToEnd/phpcbf_test.sh b/tests/EndToEnd/phpcbf_test.sh index 3886832342..8cbe14665d 100644 --- a/tests/EndToEnd/phpcbf_test.sh +++ b/tests/EndToEnd/phpcbf_test.sh @@ -5,21 +5,21 @@ function tear_down() { } function test_phpcbf_is_working() { - OUTPUT="$(bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)" + OUTPUT="$( { bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc; } 2>&1 )" assert_successful_code assert_contains "No violations were found" "$OUTPUT" } function test_phpcbf_is_working_in_parallel() { - OUTPUT="$(bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)" + 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 )" assert_successful_code assert_contains "No violations were found" "$OUTPUT" } function test_phpcbf_returns_error_on_issues() { - OUTPUT="$(bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)" + OUTPUT="$( { bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" assert_exit_code 1 assert_contains "F 1 / 1 (100%)" "$OUTPUT" diff --git a/tests/EndToEnd/phpcs_test.sh b/tests/EndToEnd/phpcs_test.sh index 3bdf41708d..c89b8b4cbd 100644 --- a/tests/EndToEnd/phpcs_test.sh +++ b/tests/EndToEnd/phpcs_test.sh @@ -9,7 +9,7 @@ function test_phpcs_is_working_in_parallel() { } function test_phpcs_returns_error_on_issues() { - OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)" + OUTPUT="$( { bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" assert_exit_code 2 assert_contains "E 1 / 1 (100%)" "$OUTPUT" From 3aed09a407dd49775dd6d190c5bbff23c7228d7d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Aug 2025 16:03:53 +0200 Subject: [PATCH 4/5] EndToEnd Tests: fix the code to allow for new exit codes As of PHPCS 4.0, the exit codes have changed. This commit fixes the tests to expect the new exit codes. --- tests/EndToEnd/phpcbf_test.sh | 2 +- tests/EndToEnd/phpcs_test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/EndToEnd/phpcbf_test.sh b/tests/EndToEnd/phpcbf_test.sh index 8cbe14665d..e3d035ea78 100644 --- a/tests/EndToEnd/phpcbf_test.sh +++ b/tests/EndToEnd/phpcbf_test.sh @@ -20,7 +20,7 @@ function test_phpcbf_is_working_in_parallel() { function test_phpcbf_returns_error_on_issues() { OUTPUT="$( { bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" - assert_exit_code 1 + assert_successful_code assert_contains "F 1 / 1 (100%)" "$OUTPUT" assert_contains "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" "$OUTPUT" diff --git a/tests/EndToEnd/phpcs_test.sh b/tests/EndToEnd/phpcs_test.sh index c89b8b4cbd..dcc643b03b 100644 --- a/tests/EndToEnd/phpcs_test.sh +++ b/tests/EndToEnd/phpcs_test.sh @@ -10,7 +10,7 @@ function test_phpcs_is_working_in_parallel() { function test_phpcs_returns_error_on_issues() { OUTPUT="$( { bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" - assert_exit_code 2 + assert_exit_code 1 assert_contains "E 1 / 1 (100%)" "$OUTPUT" assert_contains "FOUND 1 ERROR AFFECTING 1 LINE" "$OUTPUT" From 23bf79fe323d1e83622afbf677867d2a6da669eb Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 8 Aug 2025 16:20:01 +0200 Subject: [PATCH 5/5] EndToEnd Tests: fix up the command for parallel expectations --- tests/EndToEnd/phpcbf_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/EndToEnd/phpcbf_test.sh b/tests/EndToEnd/phpcbf_test.sh index e3d035ea78..d8eeae0462 100644 --- a/tests/EndToEnd/phpcbf_test.sh +++ b/tests/EndToEnd/phpcbf_test.sh @@ -19,7 +19,7 @@ function test_phpcbf_is_working_in_parallel() { } function test_phpcbf_returns_error_on_issues() { - OUTPUT="$( { bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" + 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 )" assert_successful_code assert_contains "F 1 / 1 (100%)" "$OUTPUT"