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

SymfonyFactoryTest::testCreateClient()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 2
nc 2
nop 0
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