Skip to content

Commit 5ef812f

Browse files
committed
Added require HYDRATE_CLASS constant to test resource
1 parent b31353e commit 5ef812f

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/StreamingClientTest.php

+7-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use ApiClients\Tools\TestUtilities\TestCase;
1111
use Prophecy\Argument;
1212
use React\EventLoop\Factory;
13+
use function React\Promise\reject;
1314
use Rx\Observable;
1415

1516
final class StreamingClientTest extends TestCase
@@ -72,20 +73,18 @@ public function streamingClientProvider()
7273
*/
7374
public function testStreamingClient(string $method, array $args)
7475
{
75-
$resource = $this->prophesize(ResourceInterface::class);
76+
$resource = new class() implements ResourceInterface {
77+
const HYDRATE_CLASS = 'HYDRATE_CLASS';
78+
};
7679
$listener = function () {};
7780
$loop = Factory::create();
7881
$commandBus = $this->prophesize(CommandBusInterface::class);
79-
$commandBus->handle(Argument::type(BuildSyncFromAsyncCommand::class))->shouldBeCalled()->willReturn(\React\Promise\reject());
80-
/*$container = ContainerBuilder::buildDevContainer();
81-
$container->set(LoopInterface::class, Factory::create());
82-
$container->set(CommandBusInterface::class, $commandBus->reveal());
83-
$client = new Client($container);*/
82+
$commandBus->handle(Argument::type(BuildSyncFromAsyncCommand::class))->shouldBeCalled()->willReturn(reject());
8483
$observableSecond = $this->prophesize(Observable::class);
85-
$observableSecond->subscribeCallback($listener, Argument::type('callable'))->shouldBeCalled();
84+
$observableSecond->subscribe($listener, Argument::type('callable'))->shouldBeCalled();
8685
$observableFirst = $this->prophesize(Observable::class);
8786
$observableFirst->flatMap(Argument::that(function (callable $callable) use ($resource) {
88-
$callable($resource->reveal());
87+
$callable($resource);
8988
return true;
9089
}))->shouldBeCalled()->willReturn($observableSecond->reveal());
9190
$asyncStreamingClient = $this->prophesize(AsyncStreamingClientInterface::class);

0 commit comments

Comments
 (0)