Completed
Pull Request — master (#1)
by Daniel
10:00
created

PhpcrOdmTestCase::initPhpcr()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 11
rs 9.4285
c 1
b 0
f 0
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 Psi\Component\ContentType\Tests\Functional\Example\Model\Article;
7
use Psi\Component\ContentType\Tests\Functional\Example\Model\Image;
8
use Doctrine\DBAL\DriverManager;
9
use PhpBench\DependencyInjection\Container;
10
11
class PhpcrOdmTestCase extends \PHPUnit_Framework_TestCase
12
{
13
    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...
14
15
    protected function getContainer()
16
    {
17
        $container = new Container([
18
            \Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional\PhpcrOdmExtension::class
19
        ], []);
20
        $container->init();
21
        return $container;
22
    }
23
24
    protected function initPhpcr(DocumentManagerInterface $documentManager)
25
    {
26
        $session = $documentManager->getPhpcrSession();
27
28
        $rootNode = $session->getRootNode();
29
        if ($rootNode->hasNode('test')) {
30
            $rootNode->getNode('test')->remove();
31
        }
32
33
        $rootNode->addNode('test');
34
    }
35
}
36