Skip to content

Commit e23fdf9

Browse files
committed
E2E tests: rename fixtures directory
... to be in line with other test fixture directories.
1 parent 055f135 commit e23fdf9

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
composer.lock
99
phpstan.neon
1010
/node_modules/
11+
/tests/EndToEnd/Fixtures/*.fixed

phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<exclude-pattern>*/src/Standards/*/Tests/*\.(inc|css|js)$</exclude-pattern>
1212
<exclude-pattern>*/tests/Core/*/*\.(inc|css|js)$</exclude-pattern>
1313
<exclude-pattern>*/tests/Core/*/Fixtures/*\.php$</exclude-pattern>
14-
<exclude-pattern>*/tests/EndToEnd/Files/*\.inc$</exclude-pattern>
14+
<exclude-pattern>*/tests/EndToEnd/Fixtures/*\.inc$</exclude-pattern>
1515

1616
<arg name="basepath" value="."/>
1717
<arg name="colors"/>

tests/EndToEnd/Files/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/EndToEnd/Files/ClassOneWithoutStyleError.inc renamed to tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
88
*/
99

10-
namespace PHP_CodeSniffer\Tests\EndToEnd\Files;
10+
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
1111

1212
class ClassOneWithoutStyleError
1313
{

tests/EndToEnd/Files/ClassTwoWithoutStyleError.inc renamed to tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
88
*/
99

10-
namespace PHP_CodeSniffer\Tests\EndToEnd\Files;
10+
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
1111

1212
class ClassTwoWithoutStyleError
1313
{

tests/EndToEnd/Files/ClassWithStyleError.inc renamed to tests/EndToEnd/Fixtures/ClassWithStyleError.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
88
*/
99

10-
namespace PHP_CodeSniffer\Tests\EndToEnd\Files;
10+
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
1111

1212
class ClassWithStyleError
1313
{

tests/EndToEnd/Files/phpcs.xml.dist renamed to tests/EndToEnd/Fixtures/phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="EndToEndTests" xsi:noNamespaceSchemaLocation="phpcs.xsd">
33
<description>The coding standard for end to end tests.</description>
44

55
<rule ref="PSR12"/>

tests/EndToEnd/phpcbf_test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#!/usr/bin/env bash
22

33
function tear_down() {
4-
rm -r tests/EndToEnd/Files/*.fixed
4+
rm -r tests/EndToEnd/Fixtures/*.fixed
55
}
66

77
function 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

1414
function 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

2121
function 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
}

tests/EndToEnd/phpcs_test.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22

33
function test_phpcs_is_working() {
4-
assert_successful_code "$(bin/phpcs --no-cache --standard=tests/EndToEnd/Files/phpcs.xml.dist tests/EndToEnd/Files/ClassOneWithoutStyleError.inc tests/EndToEnd/Files/ClassTwoWithoutStyleError.inc)"
4+
assert_successful_code "$(bin/phpcs --no-cache --standard=tests/EndToEnd/Fixtures/phpcs.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
55
}
66

77
function test_phpcs_is_working_in_parallel() {
8-
assert_successful_code "$(bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Files/phpcs.xml.dist tests/EndToEnd/Files/ClassOneWithoutStyleError.inc tests/EndToEnd/Files/ClassTwoWithoutStyleError.inc)"
8+
assert_successful_code "$(bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/phpcs.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
99
}
1010

1111
function test_phpcs_returns_error_on_issues() {
12-
OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Files/phpcs.xml.dist tests/EndToEnd/Files/ClassWithStyleError.inc)"
12+
OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/phpcs.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
1313
assert_exit_code 2
1414

1515
assert_contains "E 1 / 1 (100%)" "$OUTPUT"
@@ -20,9 +20,9 @@ function test_phpcs_bug_1112() {
2020
# See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
2121
if [[ "$(uname)" == "Darwin" ]]; then
2222
# Perform some magic with `& fg` to prevent the processes from turning into a background job.
23-
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Files/phpcs.xml.dist tests/EndToEnd/Files/ClassOneWithoutStyleError.inc tests/EndToEnd/Files/ClassTwoWithoutStyleError.inc" & fg')"
23+
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/phpcs.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc" & fg')"
2424
else
2525
# This is not needed on Linux / GitHub Actions
26-
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Files/phpcs.xml.dist tests/EndToEnd/Files/ClassOneWithoutStyleError.inc tests/EndToEnd/Files/ClassTwoWithoutStyleError.inc"')"
26+
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/phpcs.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc"')"
2727
fi
2828
}

0 commit comments

Comments
 (0)