Completed
Push — feature/use-project-cacehe-fol... ( 0328c1 )
by Mike
09:34
created

ServiceProviderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 9 1
A test_that_the_twig_writer_is_set() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace phpDocumentor\Plugin\Twig;
6
7
use phpDocumentor\Transformer\Router\Queue;
8
use phpDocumentor\Transformer\Writer\Collection;
9
use phpDocumentor\Translator\Translator;
10
use Pimple\Container;
11
use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
12
13
final class ServiceProviderTest extends \PHPUnit\Framework\TestCase
14
{
15
    /** @var Container */
16
    private $container;
17
18
    /** @var Collection */
19
    private $writerCollection;
20
21
    public function setUp()
22
    {
23
        $this->container = new Container(new SymfonyContainer());
24
        $this->writerCollection = new Collection(new Queue());
25
26
        $this->container['translator'] = new Translator();
27
        $this->container['transformer.writer.collection'] = $this->writerCollection;
28
        $this->container[\Twig\Environment::class] = new \Twig\Environment();
29
    }
30
31
    public function test_that_the_twig_writer_is_set()
32
    {
33
        $serviceProvider = new ServiceProvider();
34
        $serviceProvider->register($this->container);
35
36
        $this->assertTrue(isset($this->writerCollection['twig']));
37
    }
38
}
39