Completed
Push — master ( 2e5d0e...583994 )
by Bartko
06:02
created

getTreeAdapter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 22
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 22
rs 9.2
cc 2
eloc 14
nc 2
nop 0
1
<?php
2
namespace StefanoTreeTest\Integration;
3
4
use StefanoDb\Adapter\Adapter as DbAdapter;
5
use StefanoTree\NestedSet as TreeAdapter;
6
use StefanoTree\NestedSet\Adapter\Zend2DbAdapter;
7
use StefanoTree\NestedSet\Options;
8
9
class NestedSetWithZend2DbAdapterAndScopeTest
10
    extends AbstractScopeTest
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
    protected function getTreeAdapter()
13
    {
14
        $dbAdapter = new DbAdapter(array(
15
            'driver' => 'Pdo_' . ucfirst(TEST_STEFANO_DB_ADAPTER),
16
            'hostname' => TEST_STEFANO_DB_HOSTNAME,
17
            'database' => TEST_STEFANO_DB_DB_NAME,
18
            'username' => TEST_STEFANO_DB_USER,
19
            'password' => TEST_STEFANO_DB_PASSWORD
20
        ));
21
22
        $options = new Options(array(
23
            'tableName' => 'tree_traversal_with_scope',
24
            'idColumnName' => 'tree_traversal_id',
25
            'scopeColumnName' => 'scope',
26
        ));
27
28
        if ('pgsql' == TEST_STEFANO_DB_ADAPTER) {
29
            $options->setSequenceName('tree_traversal_with_scope_tree_traversal_id_seq');
30
        }
31
32
        return new TreeAdapter(new Zend2DbAdapter($options, $dbAdapter));
33
    }
34
}
35