Skip to content

Commit

Permalink
Merge pull request #545 from clue-labs/update-promise
Browse files Browse the repository at this point in the history
Update test suite to remove legacy test bootstrapping
  • Loading branch information
WyriHaximus committed Nov 21, 2023
2 parents 726e5de + 24352c3 commit 709029a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
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;
}

0 comments on commit 709029a

Please sign in to comment.