Completed
Push — master ( 66a40e...8e7136 )
by David
02:31 queued 12s
created

SymfonyFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateClient() 0 14 2
1
<?php
2
3
namespace Http\HttplugBundle\Tests\Unit\ClientFactory;
4
5
use Http\HttplugBundle\ClientFactory\SymfonyFactory;
6
use PHPUnit\Framework\TestCase;
7
use Psr\Http\Message\ResponseFactoryInterface;
8
use Psr\Http\Message\StreamFactoryInterface;
9
use Symfony\Component\HttpClient\HttplugClient;
10
11
/**
12
 * @author Tobias Nyholm <[email protected]>
13
 */
14
class SymfonyFactoryTest extends TestCase
15
{
16
    public function testCreateClient(): void
17
    {
18
        if (!class_exists(HttplugClient::class)) {
19
            $this->markTestSkipped('Symfony Http client is not installed');
20
        }
21
22
        $factory = new SymfonyFactory(
23
            $this->getMockBuilder(ResponseFactoryInterface::class)->getMock(),
24
            $this->getMockBuilder(StreamFactoryInterface::class)->getMock()
25
        );
26
        $client = $factory->createClient();
27
28
        $this->assertInstanceOf(HttplugClient::class, $client);
29
    }
30
}
31