Skip to content

Commit 7bc2ff3

Browse files
authored
Merge pull request #995 from PHPCSStandards/phpcs-4.0/feature/25-refactor-testsuite
Tests: refactor the test framework
2 parents be84dd8 + ca10641 commit 7bc2ff3

File tree

11 files changed

+68
-469
lines changed

11 files changed

+68
-469
lines changed

.github/workflows/quicktest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ jobs:
6060

6161
- name: 'PHPUnit: run the full test suite'
6262
if: ${{ matrix.os != 'windows-latest' }}
63-
run: php "vendor/bin/phpunit" tests/AllTests.php --no-coverage
63+
run: php "vendor/bin/phpunit" --no-coverage
6464

6565
- name: 'PHPUnit: run tests which may have different outcomes on Windows'
6666
if: ${{ matrix.os == 'windows-latest' }}
67-
run: php "vendor/bin/phpunit" tests/AllTests.php --group Windows --no-coverage
67+
run: php "vendor/bin/phpunit" --group Windows --no-coverage
6868

6969
- name: 'PHPUnit: run select tests in CBF mode'
70-
run: php "vendor/bin/phpunit" tests/AllTests.php --group CBF --exclude-group nothing --no-coverage
70+
run: php "vendor/bin/phpunit" --group CBF --exclude-group nothing --no-coverage
7171
env:
7272
PHP_CODESNIFFER_CBF: '1'
7373

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ jobs:
204204

205205
- name: 'PHPUnit: run the full test suite without code coverage'
206206
if: ${{ matrix.skip_tests != true }}
207-
run: php "vendor/bin/phpunit" tests/AllTests.php --no-coverage
207+
run: php "vendor/bin/phpunit" --no-coverage
208208

209209
- name: 'PHPUnit: run select tests in CBF mode'
210210
if: ${{ matrix.skip_tests != true }}
211-
run: php "vendor/bin/phpunit" tests/AllTests.php --group CBF --exclude-group nothing --no-coverage
211+
run: php "vendor/bin/phpunit" --group CBF --exclude-group nothing --no-coverage
212212
env:
213213
PHP_CODESNIFFER_CBF: '1'
214214

@@ -307,13 +307,13 @@ jobs:
307307
- name: "Run the unit tests with code coverage"
308308
if: ${{ matrix.os != 'windows-latest' }}
309309
run: >
310-
php "vendor/bin/phpunit" tests/AllTests.php
310+
php "vendor/bin/phpunit"
311311
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
312312
313313
- name: "Run select tests in CBF mode with code coverage"
314314
if: ${{ matrix.os != 'windows-latest' }}
315315
run: >
316-
php "vendor/bin/phpunit" tests/AllTests.php
316+
php "vendor/bin/phpunit"
317317
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
318318
--group CBF --exclude-group nothing --coverage-clover build/logs/clover-cbf.xml
319319
env:
@@ -322,7 +322,7 @@ jobs:
322322
- name: "Run the unit tests which may have different outcomes on Windows with code coverage"
323323
if: ${{ matrix.os == 'windows-latest' }}
324324
run: >
325-
php "vendor/bin/phpunit" tests/AllTests.php --group Windows
325+
php "vendor/bin/phpunit" --group Windows
326326
${{ steps.phpunit_version.outputs.VERSION >= '9.3' && '--coverage-cache ./build/phpunit-cache' || '' }}
327327
328328
- name: "Upload coverage results to Coveralls (normal run)"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@
5959
],
6060
"test": [
6161
"Composer\\Config::disableProcessTimeout",
62-
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --no-coverage"
62+
"@php ./vendor/phpunit/phpunit/phpunit --no-coverage"
6363
],
6464
"coverage": [
6565
"Composer\\Config::disableProcessTimeout",
66-
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php -d max_execution_time=0"
66+
"@php ./vendor/phpunit/phpunit/phpunit -d max_execution_time=0"
6767
],
6868
"coverage-local": [
6969
"Composer\\Config::disableProcessTimeout",
70-
"@php ./vendor/phpunit/phpunit/phpunit tests/AllTests.php --coverage-html ./build/coverage-html -d max_execution_time=0"
70+
"@php ./vendor/phpunit/phpunit/phpunit --coverage-html ./build/coverage-html -d max_execution_time=0"
7171
],
7272
"build": [
7373
"Composer\\Config::disableProcessTimeout",

phpunit.xml.dist

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@
1313
forceCoversAnnotation="true"
1414
>
1515
<testsuites>
16-
<testsuite name="PHP_CodeSniffer Test Suite">
17-
<file>tests/AllTests.php</file>
16+
<testsuite name="PHPCS_Core">
17+
<directory>./tests/Core/</directory>
18+
</testsuite>
19+
<testsuite name="PHPCS_Sniffs">
20+
<directory>./src/Standards/Generic/Tests/</directory>
21+
<directory>./src/Standards/PEAR/Tests/</directory>
22+
<directory>./src/Standards/PSR1/Tests/</directory>
23+
<directory>./src/Standards/PSR2/Tests/</directory>
24+
<directory>./src/Standards/PSR12/Tests/</directory>
25+
<directory>./src/Standards/Squiz/Tests/</directory>
26+
<directory>./src/Standards/Zend/Tests/</directory>
1827
</testsuite>
1928
</testsuites>
2029

tests/AllTests.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

tests/Core/AllTests.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

tests/FileList.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)