Completed
Pull Request — master (#15)
by Artem
01:24
created

setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the FreshVichUploaderSerializationBundle
4
 *
5
 * (c) Artem Henvald <[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 Henvald <[email protected]>
20
 */
21
class FreshVichUploaderSerializationExtensionTest extends \PHPUnit_Framework_TestCase
22
{
23
    /** @var FreshVichUploaderSerializationExtension */
24
    private $extension;
25
26
    /** @var ContainerBuilder */
27
    private $container;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function setUp()
33
    {
34
        $this->extension = new FreshVichUploaderSerializationExtension();
35
        $this->container = new ContainerBuilder();
36
        $this->container->registerExtension($this->extension);
37
    }
38
39
    public function testLoadExtension()
40
    {
41
        // Add some dummy required services
42
        $this->container->set('vich_uploader.storage', new \stdClass());
43
        $this->container->set('router.request_context', new \stdClass());
44
        $this->container->set('annotations.cached_reader', new \stdClass());
45
        $this->container->set('logger', new \stdClass());
46
        $this->container->set('property_accessor', new \stdClass());
47
48
        $this->container->loadFromExtension($this->extension->getAlias());
49
        $this->container->compile();
50
51
        $this->assertFalse($this->container->has('vich_uploader_serialization.jms_serializer.subscriber')); // because private
52
    }
53
}
54