Skip to content

Commit 260fce1

Browse files
committed
Move utility tests to WordPress/Helpers/Tests/ContextHelper/
1 parent a523676 commit 260fce1

File tree

5 files changed

+4
-24
lines changed

5 files changed

+4
-24
lines changed

Tests/bootstrap.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@
4545
) {
4646
require_once $phpcsDir . $ds . 'autoload.php';
4747
require_once $phpcsDir . $ds . 'tests' . $ds . 'bootstrap.php'; // PHPUnit 6.x+ support.
48-
49-
spl_autoload_register(
50-
function ( $className ) {
51-
// Only try & load our own classes.
52-
if ( stripos( $className, 'WordPressCS' ) !== 0 ) {
53-
return;
54-
}
55-
56-
$file = realpath( dirname( __DIR__ ) ) . DIRECTORY_SEPARATOR . strtr( str_replace( 'WordPressCS\\', '', $className ), '\\', DIRECTORY_SEPARATOR ) . '.php';
57-
58-
if ( file_exists( $file ) ) {
59-
include_once $file;
60-
}
61-
}
62-
);
6348
} else {
6449
echo 'Uh oh... can\'t find PHPCS.
6550

WordPress/Util/Tests/Helpers/ContextHelper/IsInFunctionCallUnitTest.php renamed to WordPress/Tests/Helpers/ContextHelper/IsInFunctionCallUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @license https://opensource.org/licenses/MIT MIT
88
*/
99

10-
namespace WordPressCS\WordPress\Util\Tests\Helpers\ContextHelper;
10+
namespace WordPressCS\WordPress\Tests\Helpers\ContextHelper;
1111

1212
use PHPCSUtils\Tokens\Collections;
1313
use WordPressCS\WordPress\Helpers\ContextHelper;

composer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@
5353
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
5454
],
5555
"run-tests": [
56-
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php --no-coverage",
57-
"@php ./vendor/phpunit/phpunit/phpunit WordPress/Util/Tests/ --no-coverage"
56+
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php --no-coverage"
5857
],
5958
"coverage": [
60-
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php",
61-
"@php ./vendor/phpunit/phpunit/phpunit WordPress/Util/Tests/"
59+
"@php ./vendor/phpunit/phpunit/phpunit --filter WordPress ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
6260
],
6361
"check-complete": [
6462
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./WordPress"

phpunit.xml.dist

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
forceCoversAnnotation="true">
1414

1515
<testsuites>
16-
<testsuite name="WordPress Utilities Tests">
17-
<directory suffix="UnitTest.php">./WordPress/Util/Tests/</directory>
18-
</testsuite>
19-
<testsuite name="WordPress Sniffs Tests">
16+
<testsuite name="WordPress Tests">
2017
<directory suffix="UnitTest.php">./WordPress/Tests/</directory>
2118
</testsuite>
2219
</testsuites>

0 commit comments

Comments
 (0)