Completed
Push — master ( fd7370...afa46a )
by Joachim
04:42
created

TranslatorTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetter() 0 13 1
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Tests\Translation;
4
5
use Loevgaard\DandomainAltapayBundle\EventListener\ControllerListener;
6
use Loevgaard\DandomainAltapayBundle\EventListener\ResponseListener;
7
use Loevgaard\DandomainAltapayBundle\Http\TransactionLogger;
8
use Loevgaard\DandomainAltapayBundle\Tests\EventListener\Fixture\ControllerWithAnnotation;
9
use Loevgaard\DandomainAltapayBundle\Tests\Translation\Fixture\UsingTranslator;
10
use Loevgaard\DandomainAltapayBundle\Translation\TranslatorTrait;
11
use PHPUnit\Framework\TestCase;
12
use Doctrine\Common\Annotations\AnnotationReader;
13
use Symfony\Component\DependencyInjection\ContainerInterface;
14
use Symfony\Component\HttpFoundation\Request;
15
use Symfony\Component\HttpFoundation\Response;
16
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
17
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
18
use Symfony\Component\HttpKernel\HttpKernelInterface;
19
use Symfony\Component\Translation\IdentityTranslator;
20
21
class TranslatorTraitTest extends TestCase
22
{
23
    public function testGetter()
24
    {
25
        /** @var ContainerInterface|\PHPUnit_Framework_MockObject_MockObject $container */
26
        $container = $this->getMockBuilder(ContainerInterface::class)
27
            ->disableOriginalConstructor()
28
            ->getMock();
29
30
        $container->method('get')->willReturn(new IdentityTranslator());
31
32
        $obj = new UsingTranslator($container);
33
34
        $this->assertInstanceOf(IdentityTranslator::class, $obj->getIt());
35
    }
36
}
37