Completed
Push — develop ( e8f38f...66df04 )
by Bartko
03:20
created

Zend1Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAdapter() 0 20 2
1
<?php
2
namespace StefanoTreeTest\Integration\Adapter;
3
4
use StefanoTree\NestedSet\Adapter\AdapterInterface as TreeAdapterInterface;
5
use StefanoTree\NestedSet\Adapter\Zend1 as NestedSetAdapter;
6
use StefanoTree\NestedSet\Options;
7
8
9
class Zend1Test
10
    extends AdapterTestAbstract
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
    /**
13
     * @return TreeAdapterInterface
14
     */
15
    protected function getAdapter()
16
    {
17
        $dbAdapter = \Zend_Db::factory('Pdo_' . ucfirst(TEST_STEFANO_DB_ADAPTER), array(
18
            'host' => TEST_STEFANO_DB_HOSTNAME,
19
            'dbname' => TEST_STEFANO_DB_DB_NAME,
20
            'username' => TEST_STEFANO_DB_USER,
21
            'password' => TEST_STEFANO_DB_PASSWORD
22
        ));
23
24
        $options = new Options(array(
25
            'tableName' => 'tree_traversal',
26
            'idColumnName' => 'tree_traversal_id',
27
        ));
28
29
        if ('pgsql' == TEST_STEFANO_DB_ADAPTER) {
30
            $options->setSequenceName('tree_traversal_tree_traversal_id_seq');
31
        }
32
33
        return new NestedSetAdapter($options, $dbAdapter);
34
    }
35
}
36