MockFactoryTest::testCreateClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
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