11#! /usr/bin/env bash
22
33function tear_down() {
4- rm -r tests/EndToEnd/Files /* .fixed
4+ rm -r tests/EndToEnd/Fixtures /* .fixed
55}
66
77function test_phpcbf_is_working() {
8- OUTPUT=" $( bin/phpcbf --no-cache --standard=tests/EndToEnd/Files /phpcs.xml.dist tests/EndToEnd/Files /ClassOneWithoutStyleError.inc tests/EndToEnd/Files /ClassTwoWithoutStyleError.inc) "
8+ OUTPUT=" $( bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures /phpcs.xml.dist tests/EndToEnd/Fixtures /ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures /ClassTwoWithoutStyleError.inc) "
99
1010 assert_successful_code
1111 assert_contains " No violations were found" " $OUTPUT "
1212}
1313
1414function test_phpcbf_is_working_in_parallel() {
15- OUTPUT=" $( bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Files /phpcs.xml.dist tests/EndToEnd/Files /ClassOneWithoutStyleError.inc tests/EndToEnd/Files /ClassTwoWithoutStyleError.inc) "
15+ OUTPUT=" $( bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures /phpcs.xml.dist tests/EndToEnd/Fixtures /ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures /ClassTwoWithoutStyleError.inc) "
1616
1717 assert_successful_code
1818 assert_contains " No violations were found" " $OUTPUT "
1919}
2020
2121function test_phpcbf_returns_error_on_issues() {
22- OUTPUT=" $( bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Files /phpcs.xml.dist tests/EndToEnd/Files /ClassWithStyleError.inc) "
22+ OUTPUT=" $( bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures /phpcs.xml.dist tests/EndToEnd/Fixtures /ClassWithStyleError.inc) "
2323 assert_exit_code 1
2424
2525 assert_contains " F 1 / 1 (100%)" " $OUTPUT "
@@ -30,9 +30,9 @@ function test_phpcbf_bug_1112() {
3030 # See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
3131 if [[ " $( uname) " == " Darwin" ]]; then
3232 # Perform some magic with `& fg` to prevent the processes from turning into a background job.
33- assert_successful_code " $( bash -ic ' bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Files /phpcs.xml.dist tests/EndToEnd/Files /ClassOneWithoutStyleError.inc tests/EndToEnd/Files /ClassTwoWithoutStyleError.inc" & fg' ) "
33+ assert_successful_code " $( bash -ic ' bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures /phpcs.xml.dist tests/EndToEnd/Fixtures /ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures /ClassTwoWithoutStyleError.inc" & fg' ) "
3434 else
3535 # This is not needed on Linux / GitHub Actions
36- assert_successful_code " $( bash -ic ' bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Files /phpcs.xml.dist tests/EndToEnd/Files /ClassOneWithoutStyleError.inc tests/EndToEnd/Files /ClassTwoWithoutStyleError.inc"' ) "
36+ assert_successful_code " $( bash -ic ' bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures /phpcs.xml.dist tests/EndToEnd/Fixtures /ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures /ClassTwoWithoutStyleError.inc"' ) "
3737 fi
3838}
0 commit comments