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

ConfigurationTest::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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