Completed
Push — master ( c9036e...5033a3 )
by Bartko
05:59
created

Doctrine2DBALTest::getAdapter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
namespace StefanoTreeTest\Integration\Adapter;
3
4
use StefanoTree\NestedSet\Adapter\AdapterInterface as TreeAdapterInterface;
5
use StefanoTree\NestedSet\Adapter\Doctrine2DBAL as NestedSetAdapter;
6
use StefanoTree\NestedSet\Options;
7
use StefanoTreeTest\TestUtil;
8
9
class Doctrine2DBALTest
10
    extends AdapterTestAbstract
0 ignored issues
show
Coding Style introduced by
The extends keyword must be on the same line as the class name
Loading history...
11
{
12
    /**
13
     * @return TreeAdapterInterface
14
     */
15
    protected function getAdapter()
16
    {
17
        $options = new Options(array(
18
            'tableName' => 'tree_traversal',
19
            'idColumnName' => 'tree_traversal_id',
20
        ));
21
22
        if ('pgsql' == TEST_STEFANO_DB_ADAPTER) {
23
            $options->setSequenceName('tree_traversal_tree_traversal_id_seq');
24
        }
25
26
        return new NestedSetAdapter($options, TestUtil::getDoctrine2Connection());
27
    }
28
}
29