Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test suite to remove legacy test bootstrapping #545

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"react/dns": "^1.11",
"react/event-loop": "^1.4",
"react/http": "^1.8",
"react/promise": "^3 || ^2.10 || ^1.2",
"react/promise": "^3 || ^2.10 || ^1.3",
"react/promise-stream": "^1.6",
"react/promise-timer": "^1.9",
"react/socket": "^1.13",
Expand All @@ -26,7 +26,6 @@
"react/async": "^4.2@dev || ^3.2@dev || ^4 || ^3 || ^2",
"react/dns": "^1.12@dev",
"react/http": "^1.10@dev",
"react/promise": "^3@dev || ^2.10 || ^1.2",
"react/promise-stream": "^1.7@dev",
"react/promise-timer": "^1.10@dev",
"react/socket": "^1.14@dev"
Expand Down
18 changes: 3 additions & 15 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

$autoload = require __DIR__ . '/../vendor/autoload.php';

// register all `autoload-dev` paths from React's components
assert($autoload instanceof Composer\Autoload\ClassLoader);

// register all `autoload-dev` paths from ReactPHP's components
foreach (glob(__DIR__ . '/../vendor/react/*/composer.json') as $b) {
$config = json_decode(file_get_contents($b), true);

Expand All @@ -15,17 +17,3 @@
}
}
}

// load all legacy test bootstrap scripts from React's components
foreach (glob(__DIR__ . '/../vendor/react/*/tests/bootstrap.php') as $b) {
// skip legacy react/promise for now and use manual autoload path from bootstrap config
// @link https://github.com/reactphp/promise/blob/1.x/tests/bootstrap.php
// @link https://github.com/reactphp/promise/blob/2.x/tests/bootstrap.php
if (strpos($b, 'react/promise/tests/bootstrap.php') !== false) {
$autoload->add('React\Promise', __DIR__ . '/../vendor/react/promise/tests');
$autoload->addPsr4('React\\Promise\\', __DIR__ . '/../vendor/react/promise/tests');
continue;
}

include $b;
}