@@ 16-42 (lines=27) @@ | ||
13 | * |
|
14 | * @author Ruben Knol <[email protected]> |
|
15 | */ |
|
16 | class Guzzle5Test extends AbstractTestCase |
|
17 | { |
|
18 | /** |
|
19 | * Skip this test if Guzzle ^6.0 is installed. |
|
20 | */ |
|
21 | public function setUp() |
|
22 | { |
|
23 | if (version_compare(ClientInterface::VERSION, '6.0', '>=')) { |
|
24 | $this->markTestSkipped('Skipping test when Guzzle ~6.0 is installed'); |
|
25 | } |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Assert whether when Guzzle ^5.0 is installed, the right instance |
|
30 | * of the API client is placed in the dependency injection container. |
|
31 | */ |
|
32 | public function testHasGuzzle5Client() |
|
33 | { |
|
34 | $container = new ContainerBuilder(); |
|
35 | $loader = new VMProApiExtension(); |
|
36 | $config = $this->getFullConfig(); |
|
37 | ||
38 | $loader->load($config, $container); |
|
39 | ||
40 | $this->assertInstanceOf(Guzzle5ApiClient::class, $container->get('vmpro_api.client')); |
|
41 | } |
|
42 | } |
|
43 |
@@ 16-42 (lines=27) @@ | ||
13 | * |
|
14 | * @author Ruben Knol <[email protected]> |
|
15 | */ |
|
16 | class Guzzle6Test extends AbstractTestCase |
|
17 | { |
|
18 | /** |
|
19 | * Skip this test if Guzzle ^6.0 is installed. |
|
20 | */ |
|
21 | public function setUp() |
|
22 | { |
|
23 | if (version_compare(ClientInterface::VERSION, '6.0', '<')) { |
|
24 | $this->markTestSkipped('Skipping test when Guzzle ~6.0 is installed'); |
|
25 | } |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * Assert whether when Guzzle ^6.0 is installed, the right instance |
|
30 | * of the API client is placed in the dependency injection container. |
|
31 | */ |
|
32 | public function testHasGuzzle6Client() |
|
33 | { |
|
34 | $container = new ContainerBuilder(); |
|
35 | $loader = new VMProApiExtension(); |
|
36 | $config = $this->getFullConfig(); |
|
37 | ||
38 | $loader->load($config, $container); |
|
39 | ||
40 | $this->assertInstanceOf(Guzzle6ApiClient::class, $container->get('vmpro_api.client')); |
|
41 | } |
|
42 | } |
|
43 |