Skip to content

Commit 16aefe3

Browse files
authored
Merge pull request reactphp#110 from WyriHaximus-labs/0.2.x-replace-clue-block-react-with-react-async
Update test suite to use new reactphp/async package instead of clue/reactphp-block
2 parents 52dc32b + 18401db commit 16aefe3

8 files changed

+131
-132
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"wyrihaximus/react-child-process-promise-closure": "^1.0"
2222
},
2323
"require-dev": {
24-
"clue/block-react": "^1.4",
25-
"phpunit/phpunit": "^9.5"
24+
"phpunit/phpunit": "^9.5",
25+
"react/async": "^4 || ^3"
2626
},
2727
"autoload": {
2828
"psr-4": {

composer.lock

Lines changed: 105 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/AbstractFilesystemTestCase.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use React\EventLoop\LoopInterface;
1212
use React\Filesystem\Factory;
1313
use React\Filesystem\AdapterInterface;
14-
use React\Promise\PromiseInterface;
15-
use function Clue\React\Block\await;
1614

1715
abstract class AbstractFilesystemTestCase extends TestCase
1816
{
@@ -35,9 +33,4 @@ final public function provideFilesystems(): iterable
3533

3634
yield 'factory' => [Factory::create()];
3735
}
38-
39-
public function await(PromiseInterface $promise)
40-
{
41-
return await($promise, EventLoop\Loop::get(), 30);
42-
}
4336
}

tests/DirectoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use React\Filesystem\Node\FileInterface;
99
use React\Filesystem\Stat;
1010
use React\Promise\PromiseInterface;
11-
use function Clue\React\Block\await;
11+
use function React\Async\await;
1212

1313
final class DirectoryTest extends AbstractFilesystemTestCase
1414
{
@@ -19,7 +19,7 @@ final class DirectoryTest extends AbstractFilesystemTestCase
1919
*/
2020
public function stat(AdapterInterface $filesystem): void
2121
{
22-
$stat = $this->await($filesystem->detect(__DIR__)->then(static function (DirectoryInterface $directory): PromiseInterface {
22+
$stat = await($filesystem->detect(__DIR__)->then(static function (DirectoryInterface $directory): PromiseInterface {
2323
return $directory->stat();
2424
}));
2525

@@ -48,7 +48,7 @@ public function ls(AdapterInterface $filesystem): void
4848

4949
ksort($expectedListing);
5050

51-
$directoryListing = $this->await($filesystem->detect(__DIR__)->then(static function (DirectoryInterface $directory): PromiseInterface {
51+
$directoryListing = await($filesystem->detect(__DIR__)->then(static function (DirectoryInterface $directory): PromiseInterface {
5252
return $directory->ls();
5353
}));
5454

tests/FactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use React\Filesystem\AdapterInterface;
99
use React\Filesystem\Node\DirectoryInterface;
1010
use React\Filesystem\Node\FileInterface;
11-
use function Clue\React\Block\await;
11+
use function React\Async\await;
1212

1313
final class FactoryTest extends AbstractFilesystemTestCase
1414
{
@@ -17,7 +17,7 @@ final class FactoryTest extends AbstractFilesystemTestCase
1717
*/
1818
public function factory(): void
1919
{
20-
$node = $this->await(Factory::create()->detect(__FILE__));
20+
$node = await(Factory::create()->detect(__FILE__));
2121

2222
self::assertInstanceOf(FileInterface::class, $node);
2323
}

0 commit comments

Comments
 (0)