MockFactoryTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateClient() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * This file is part of the HttplugBundle package.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Http\HttplugBundle\Tests\Unit\ClientFactory;
12
13
use Http\HttplugBundle\ClientFactory\MockFactory;
14
use Http\Mock\Client;
15
use PHPUnit\Framework\TestCase;
16
17
/**
18
 * @author Gary PEGEOT <[email protected]>
19
 */
20
class MockFactoryTest extends TestCase
21
{
22
    public function testCreateClient(): void
23
    {
24
        $factory = new MockFactory();
25
        $client = $factory->createClient();
26
27
        $this->assertInstanceOf(Client::class, $client);
28
29
        $client = new Client();
30
31
        $factory->setClient($client);
32
33
        $this->assertSame($client, $factory->createClient());
34
    }
35
}
36