File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed
Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change 22
33namespace ApiClients \Foundation ;
44
5- use InvalidArgumentException ;
6- use League \Container \ContainerInterface ;
75use ApiClients \Tools \CommandBus \CommandBus ;
6+ use Interop \Container \ContainerInterface ;
7+ use InvalidArgumentException ;
88use React \Promise \CancellablePromiseInterface ;
99
1010final class Client
Original file line number Diff line number Diff line change 55use ApiClients \Foundation \Client ;
66use ApiClients \Tools \CommandBus \CommandBus ;
77use ApiClients \Tools \TestUtilities \TestCase ;
8- use InvalidArgumentException ;
9- use League \Container \Container ;
8+ use DI \ContainerBuilder ;
109use League \Tactician \Handler \CommandHandlerMiddleware ;
1110use League \Tactician \Handler \CommandNameExtractor \ClassNameExtractor ;
1211use League \Tactician \Handler \Locator \InMemoryLocator ;
@@ -41,19 +40,11 @@ public function handle($command)
4140
4241 $ commandBus = new CommandBus ($ loop , $ handlerMiddleware );
4342
44- $ container = new Container ();
45- $ container ->share (CommandBus::class, $ commandBus );
43+ $ container = ContainerBuilder:: buildDevContainer ();
44+ $ container ->set (CommandBus::class, $ commandBus );
4645 $ client = new Client ($ container );
4746
4847 $ this ->assertSame ($ container , $ client ->getContainer ());
4948 $ this ->assertSame ($ command , await ($ client ->handle ($ command ), $ loop ));
5049 }
51-
52- /**
53- * @expectedException InvalidArgumentException
54- */
55- public function testMissingCommandBus ()
56- {
57- new Client (new Container ());
58- }
5950}
You can’t perform that action at this time.
0 commit comments