Completed
Push — master ( bead68...29f6d6 )
by Artem
17:01
created

setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the FreshVichUploaderSerializationBundle
4
 *
5
 * (c) Artem Genvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Fresh\VichUploaderSerializationBundle\Tests\DependencyInjection;
12
13
use Fresh\VichUploaderSerializationBundle\DependencyInjection\FreshVichUploaderSerializationExtension;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
16
/**
17
 * FreshVichUploaderSerializationExtensionTest
18
 *
19
 * @author Artem Genvald <[email protected]>
20
 */
21
class FreshVichUploaderSerializationExtensionTest extends \PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @var FreshVichUploaderSerializationExtension $extension FreshVichUploaderSerializationExtension
25
     */
26
    private $extension;
27
28
    /**
29
     * @var ContainerBuilder $container Container builder
30
     */
31
    private $container;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function setUp()
37
    {
38
        $this->extension = new FreshVichUploaderSerializationExtension();
39
        $this->container = new ContainerBuilder();
40
        $this->container->registerExtension($this->extension);
41
    }
42
43
    /**
44
     * Test load extension
45
     */
46
    public function testLoadExtension()
47
    {
48
        // Add some dummy required services
49
        $this->container->set('vich_uploader.storage', new \StdClass());
50
        $this->container->set('router.request_context', new \StdClass());
51
        $this->container->set('annotations.cached_reader', new \StdClass());
52
        $this->container->set('logger', new \StdClass());
53
54
        $this->container->loadFromExtension($this->extension->getAlias());
55
        $this->container->compile();
56
57
        // Check that services have been loaded
58
        $this->assertTrue($this->container->has('vich_uploader.jms_serializer.listener'));
59
    }
60
}
61