Completed
Pull Request — master (#881)
by Webnet
01:51
created

ConfigurationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
A testGetConfigTreeBuilderDoNotUseDoctrineCommon() 0 8 1
1
<?php
2
3
namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection;
4
5
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Configuration;
6
use PHPUnit\Framework\TestCase;
7
use PHPUnit\Framework\TestResult;
8
9
class ConfigurationTest extends TestCase
10
{
11
    /**
12
     * PHPUnit hack to avoid currently loaded classes
13
     * leak to @see testGetConfigTreeBuilderDoNotUseDoctrineCommon that is run is separate process.
14
     *
15
     * @inheritdoc
16
     */
17
    public function run(TestResult $result = null)
18
    {
19
        $this->setPreserveGlobalState(false);
20
21
        return parent::run($result);
22
    }
23
24
    /**
25
     * @runInSeparateProcess
26
     */
27
    public function testGetConfigTreeBuilderDoNotUseDoctrineCommon()
28
    {
29
        $this->setPreserveGlobalState(false);
30
31
        $configuration = new Configuration(true);
32
        $configuration->getConfigTreeBuilder();
33
        $this->assertFalse(class_exists('Doctrine\Common\Proxy\AbstractProxyFactory', false));
34
    }
35
}
36