Passed
Pull Request — master (#4)
by Vincent
09:14 queued 13s
created

testServiceInstantiation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Bdf\QueueBundle\Tests\Consumption\Receiver;
4
5
use Bdf\Queue\Consumer\Receiver\Builder\ReceiverFactory;
6
use Bdf\Queue\Consumer\ReceiverInterface;
7
use Bdf\QueueBundle\Consumption\Receiver\ResetServices;
8
use Bdf\QueueBundle\Consumption\Receiver\ResetServicesFactory;
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
11
12
class ResetServicesFactoryTest extends TestCase
13
{
14
    public function testServiceInstantiation()
15
    {
16
        $receiverFactory = $this->createMock(ReceiverFactory::class);
17
        $resetter = $this->createMock(ServicesResetter::class);
18
        $next = $this->createMock(ReceiverInterface::class);
19
20
        $factory = new ResetServicesFactory();
21
22
        $this->assertInstanceOf(ResetServices::class, $factory->create($receiverFactory, $next, $resetter));
23
    }
24
25
    public function testUnknownServicesResetter()
26
    {
27
        $this->expectException(\LogicException::class);
28
29
        $receiverFactory = $this->createMock(ReceiverFactory::class);
30
        $next = $this->createMock(ReceiverInterface::class);
31
32
        $factory = new ResetServicesFactory();
33
34
        $this->assertInstanceOf(ResetServices::class, $factory->create($receiverFactory, $next));
35
    }
36
}
37