PhpcrOdmTestCase   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainer() 0 9 1
A initPhpcr() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional;
6
7
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
8
use PhpBench\DependencyInjection\Container;
9
10
class PhpcrOdmTestCase extends \PHPUnit_Framework_TestCase
11
{
12
    protected function getContainer()
13
    {
14
        $container = new Container([
15
            \Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional\PhpcrOdmExtension::class,
16
        ], []);
17
        $container->init();
18
19
        return $container;
20
    }
21
22
    protected function initPhpcr(DocumentManagerInterface $documentManager)
23
    {
24
        $session = $documentManager->getPhpcrSession();
25
26
        $rootNode = $session->getRootNode();
27
        if ($rootNode->hasNode('test')) {
28
            $rootNode->getNode('test')->remove();
29
        }
30
31
        $rootNode->addNode('test');
32
    }
33
}
34