Completed
Push — master ( 5c37fe...c17fc1 )
by Vincent
14s queued 12s
created

SonataDoctrineORMAdminExtensionTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\DoctrineORMAdminBundle\Tests\DependencyInjection;
15
16
use PHPUnit\Framework\TestCase;
17
use Sonata\DoctrineORMAdminBundle\DependencyInjection\SonataDoctrineORMAdminExtension;
18
use Symfony\Component\DependencyInjection\ContainerBuilder;
19
20
class SonataDoctrineORMAdminExtensionTest extends TestCase
21
{
22
    /**
23
     * @var ContainerBuilder
24
     */
25
    protected $configuration;
26
27
    protected function tearDown(): void
28
    {
29
        unset($this->configuration);
30
    }
31
32
    public function testEntityManagerSetFactory(): void
33
    {
34
        $this->configuration = new ContainerBuilder();
35
        $this->configuration->setParameter('kernel.bundles', ['SimpleThingsEntityAuditBundle' => true]);
36
        $loader = new SonataDoctrineORMAdminExtension();
37
        $loader->load([], $this->configuration);
38
39
        $definition = $this->configuration->getDefinition('sonata.admin.entity_manager');
40
41
        $this->assertNotNull($definition->getFactory());
42
        $this->assertNotFalse($this->configuration->getParameter('sonata_doctrine_orm_admin.audit.force'));
43
    }
44
}
45