Completed
Push — master ( f2ef3e...a98c98 )
by Bartko
01:49
created

Doctrine2DBALWithScopeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAdapter() 0 14 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace StefanoTreeTest\Integration\Adapter;
6
7
use StefanoTree\NestedSet\Adapter\AdapterInterface as TreeAdapterInterface;
8
use StefanoTree\NestedSet\Adapter\Doctrine2DBAL as NestedSetAdapter;
9
use StefanoTree\NestedSet\Options;
10
use StefanoTreeTest\TestUtil;
11
12
class Doctrine2DBALWithScopeTest extends AdapterWithScopeTestAbstract
13
{
14
    /**
15
     * @return TreeAdapterInterface
16
     */
17
    protected function getAdapter()
18
    {
19
        $options = new Options(array(
20
            'tableName' => 'tree_traversal_with_scope',
21
            'idColumnName' => 'tree_traversal_id',
22
            'scopeColumnName' => 'scope',
23
        ));
24
25
        if ('pgsql' == TEST_STEFANO_DB_ADAPTER) {
26
            $options->setSequenceName('tree_traversal_with_scope_tree_traversal_id_seq');
27
        }
28
29
        return new NestedSetAdapter($options, TestUtil::getDoctrine2Connection());
30
    }
31
}
32