Skip to content

Commit 87cfdd2

Browse files
authored
Move phpunit test suite to tests/phpunit directory (#2298)
1 parent f29b8ac commit 87cfdd2

File tree

114 files changed

+8
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+8
-8
lines changed

.distignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ README.md
4545
readme.md
4646
SECURITY.md
4747
src
48-
phpunit
48+
tests
4949
vendor

.github/workflows/phpunit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
# Extract just the method name from the full class::method
148148
METHOD_NAME=$(echo "$COVERS_TARGET" | sed 's/.*:://')
149149
echo "Extracted method name: $METHOD_NAME"
150-
if TEST_FILE=$(find phpunit/tests/ -name "*.php" -type f -exec grep -l "@covers.*$METHOD_NAME" {} \; | head -1); then
150+
if TEST_FILE=$(find tests/phpunit/tests/ -name "*.php" -type f -exec grep -l "@covers.*$METHOD_NAME" {} \; | head -1); then
151151
echo "Found test file: $TEST_FILE"
152152
if LINE_NUM=$(grep -n "@covers.*$METHOD_NAME" "$TEST_FILE" | head -1 | cut -d: -f1); then
153153
echo "Found line number: $LINE_NUM"

docs/development-environment.md

Lines changed: 1 addition & 1 deletion

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<phpunit
2-
bootstrap="phpunit/bootstrap.php"
2+
bootstrap="tests/phpunit/bootstrap.php"
33
backupGlobals="false"
44
colors="true"
55
convertErrorsToExceptions="true"
@@ -8,11 +8,11 @@
88
>
99
<testsuites>
1010
<testsuite name="ActivityPub">
11-
<directory prefix="class-test-" suffix=".php">./phpunit/tests</directory>
11+
<directory prefix="class-test-" suffix=".php">./tests/phpunit/tests</directory>
1212
</testsuite>
1313
</testsuites>
1414
<listeners>
15-
<listener class="Activitypub\Tests\Activitypub_Testcase_Timer" file="phpunit/includes/class-activitypub-testcase-timer.php" />
15+
<listener class="Activitypub\Tests\Activitypub_Testcase_Timer" file="tests/phpunit/includes/class-activitypub-testcase-timer.php" />
1616
</listeners>
1717
<coverage>
1818
<include>

phpunit/bootstrap.php renamed to tests/phpunit/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* Manually load the plugin being tested.
2727
*/
2828
function _manually_load_plugin() {
29-
require \dirname( __DIR__ ) . '/activitypub.php';
30-
$enable_mastodon_apps_plugin = dirname( dirname( __DIR__ ) ) . '/enable-mastodon-apps/enable-mastodon-apps.php'; // phpcs:ignore
29+
require __DIR__ . '/../../activitypub.php';
30+
$enable_mastodon_apps_plugin = __DIR__ . '/../../../enable-mastodon-apps/enable-mastodon-apps.php';
3131
if ( file_exists( $enable_mastodon_apps_plugin ) ) {
3232
require $enable_mastodon_apps_plugin;
3333
}
File renamed without changes.

0 commit comments

Comments
 (0)