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

NestedSetWithZend2DbAdapterAndScopeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
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 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTreeAdapter() 0 22 2
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