Completed
Pull Request — master (#1)
by Daniel
27:00 queued 13:32
created

PhpcrOdmTestCase::initPhpcr()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
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
    private $documentManager;
0 ignored issues
show
Unused Code introduced by
The property $documentManager is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
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