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

testEntityManagerSetFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

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