Skip to content

Commit 82f1c29

Browse files
committed
Support both PHP-DI 5.4.3+ and 6.x
1 parent 24cd22d commit 82f1c29

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"api-clients/hydrator": "^1.0.1",
1515
"api-clients/middleware": "^4.0 || ^3.0 || ^2.0 || ^1.1",
1616
"api-clients/transport": "^3.0 || ^2.0 || ^1.0",
17-
"php-di/php-di": "^5.4.3",
17+
"php-di/php-di": "^6.0 || ^5.4.3",
1818
"psr/container": "^1.0"
1919
},
2020
"require-dev": {

composer.lock

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

tests/ClientTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,21 @@ public function handle($command)
5454
$this->assertSame($command, await($client->handle($command), $loop));
5555
}
5656

57-
/**
58-
* @expectedException \DI\Definition\Exception\DefinitionException
59-
*/
6057
public function testCommandBusMissing()
6158
{
62-
new Client(ContainerBuilder::buildDevContainer());
59+
try {
60+
new Client(ContainerBuilder::buildDevContainer());
61+
} catch (\DI\Definition\Exception\InvalidDefinition $exception) {
62+
self::assertTrue(true);
63+
64+
return;
65+
} catch (\DI\Definition\Exception\DefinitionException $exception) {
66+
self::assertTrue(true);
67+
68+
return;
69+
}
70+
71+
self::assertTrue(false);
6372
}
6473

6574
public function testHydrate()

0 commit comments

Comments
 (0)