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

NestedSetWithZend1DbAdapterAndScopeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 5
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTreeAdapter() 0 21 2
1
<?php
2
namespace StefanoTreeTest\Integration;
3
4
use StefanoTree\NestedSet as TreeAdapter;
5
use StefanoTree\NestedSet\Adapter\Zend1DbAdapter;
6
use StefanoTree\NestedSet\Options;
7
8
class NestedSetWithZend1DbAdapterAndScopeTest
9
    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...
10
{
11
    protected function getTreeAdapter()
12
    {
13
        $dbAdapter = \Zend_Db::factory('Pdo_' . ucfirst(TEST_STEFANO_DB_ADAPTER), array(
14
            'host' => TEST_STEFANO_DB_HOSTNAME,
15
            'dbname' => TEST_STEFANO_DB_DB_NAME,
16
            'username' => TEST_STEFANO_DB_USER,
17
            'password' => TEST_STEFANO_DB_PASSWORD
18
        ));
19
20
        $options = new Options(array(
21
            'tableName' => 'tree_traversal_with_scope',
22
            'idColumnName' => 'tree_traversal_id',
23
            'scopeColumnName' => 'scope',
24
        ));
25
26
        if ('pgsql' == TEST_STEFANO_DB_ADAPTER) {
27
            $options->setSequenceName('tree_traversal_with_scope_tree_traversal_id_seq');
28
        }
29
30
        return new TreeAdapter(new Zend1DbAdapter($options, $dbAdapter));
31
    }
32
}
33