Completed
Pull Request — master (#1)
by Daniel
12:19
created

PhpcrOdmTestCase::getContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional;
4
5
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
6
use PhpBench\DependencyInjection\Container;
7
8
class PhpcrOdmTestCase extends \PHPUnit_Framework_TestCase
9
{
10
    protected function getContainer()
11
    {
12
        $container = new Container([
13
            \Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional\PhpcrOdmExtension::class,
14
        ], []);
15
        $container->init();
16
17
        return $container;
18
    }
19
20
    protected function initPhpcr(DocumentManagerInterface $documentManager)
21
    {
22
        $session = $documentManager->getPhpcrSession();
23
24
        $rootNode = $session->getRootNode();
25
        if ($rootNode->hasNode('test')) {
26
            $rootNode->getNode('test')->remove();
27
        }
28
29
        $rootNode->addNode('test');
30
    }
31
}
32