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

NestedSetWithZend2DbAdapterAndScopeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 5

1 Method

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