Skip to content

Commit 0e9e033

Browse files
committed
Adjusted client to the container interop container interface
1 parent 1500a79 commit 0e9e033

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace ApiClients\Foundation;
44

5-
use InvalidArgumentException;
6-
use League\Container\ContainerInterface;
75
use ApiClients\Tools\CommandBus\CommandBus;
6+
use Interop\Container\ContainerInterface;
7+
use InvalidArgumentException;
88
use React\Promise\CancellablePromiseInterface;
99

1010
final class Client

tests/ClientTest.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
use ApiClients\Foundation\Client;
66
use ApiClients\Tools\CommandBus\CommandBus;
77
use ApiClients\Tools\TestUtilities\TestCase;
8-
use InvalidArgumentException;
9-
use League\Container\Container;
8+
use DI\ContainerBuilder;
109
use League\Tactician\Handler\CommandHandlerMiddleware;
1110
use League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor;
1211
use 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
}

0 commit comments

Comments
 (0)