Completed
Branch unittests (a61d5f)
by Ruben
02:26
created

Guzzle6Test::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 6
loc 6
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
3
namespace MovingImage\Bundle\VMProApiBundle\Tests\DependencyInjection\VMProApiExtensionTest;
4
5
use GuzzleHttp\ClientInterface;
6
use MovingImage\Bundle\VMProApiBundle\DependencyInjection\VMProApiExtension;
7
use MovingImage\Bundle\VMProApiBundle\Tests\DependencyInjection\AbstractTestCase;
8
use MovingImage\Client\VMPro\ApiClient\Guzzle6ApiClient;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
11
/**
12
 * Class Guzzle6Test.
13
 *
14
 * @author Ruben Knol <[email protected]>
15
 */
16 View Code Duplication
class Guzzle6Test extends AbstractTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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