Skip to content

Commit

Permalink
Move test files into tests/phpunit/. (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
costdev authored Nov 13, 2024
1 parent e96c270 commit e855143
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
run: bash bin/install-wp-tests.sh wordpress_tests root root 127.0.0.1 latest true

- name: Run tests
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/multisite.xml' || '' }}
run: XDEBUG_MODE=off phpunit${{ matrix.multisite && ' -c tests/phpunit/multisite.xml' || '' }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/phpunit.xml
/vendor
.cache/*
/tests/cache
/tests/coverage
/tests/phpunit/cache
/tests/phpunit/coverage
.DS_Store

# Track placeholders so that empty directories stay in the repo.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source",
"lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary, source",
"test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit" ],
"test:multisite": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit -c tests/multisite.xml" ]
"test:multisite": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit -c tests/phpunit/multisite.xml" ]
}


Expand Down
8 changes: 4 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.2/phpunit.xsd"
bootstrap="tests/bootstrap.php"
bootstrap="tests/phpunit/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
Expand All @@ -11,15 +11,15 @@
>
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">./tests/</directory>
<directory suffix="Test.php">./tests/phpunit/tests/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>ms-required</group>
</exclude>
</groups>
<coverage includeUncoveredFiles="true" processUncoveredFiles="false" pathCoverage="true" cacheDirectory="./tests/cache">
<coverage includeUncoveredFiles="true" processUncoveredFiles="false" pathCoverage="true" cacheDirectory="./tests/phpunit/cache">
<include>
<file>./aspire-update.php</file>
<directory suffix=".php">./includes</directory>
Expand All @@ -29,7 +29,7 @@
</exclude>
<report>
<text outputFile="php://stdout" showOnlySummary="true"/>
<html outputDirectory="./tests/coverage"/>
<html outputDirectory="./tests/phpunit/coverage"/>
</report>
</coverage>
</phpunit>
2 changes: 1 addition & 1 deletion tests/bootstrap.php → tests/phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
function _manually_load_plugin() {

require dirname( __DIR__ ) . '/aspire-update.php';
require dirname( __DIR__ ) . '/../aspire-update.php';
}

tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Expand Down
7 changes: 3 additions & 4 deletions tests/multisite.xml → tests/phpunit/multisite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
>
<php>
<const name="WP_TESTS_MULTISITE" value="1" />
<const name="WP_RUN_CORE_TESTS" value="1" />
</php>
<testsuites>
<!-- Default test suite to run all tests. -->
<testsuite name="default">
<directory suffix=".php">./</directory>
<directory suffix=".php">./tests</directory>
</testsuite>
</testsuites>
<groups>
Expand All @@ -28,10 +27,10 @@
</groups>
<coverage includeUncoveredFiles="true" processUncoveredFiles="false" pathCoverage="true" cacheDirectory="./cache">
<include>
<directory suffix=".php">../includes</directory>
<directory suffix=".php">../../includes</directory>
</include>
<exclude>
<file>../includes/autoload.php</file>
<file>../../includes/autoload.php</file>
</exclude>
<report>
<text outputFile="php://stdout" showOnlySummary="true"/>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit e855143

Please sign in to comment.