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

test_that_the_twig_writer_is_set()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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