FeatureTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMapper() 0 4 1
A testInstantiate() 0 5 1
A testGetByProductIdReturnsArrayOfFeatureModels() 0 10 1
1
<?php
2
3
namespace SpeckCatalogTest\Mapper;
4
5
use SpeckCatalogTest\Mapper\TestAsset\AbstractTestCase;
6
7
class FeatureTest extends AbstractTestCase
8
{
9
    //temp method just to include this mapper
10
    public function testInstantiate()
11
    {
12
        $mapper = $this->getMapper();
13
        $this->assertTrue($mapper instanceof \SpeckCatalog\Mapper\Feature);
14
    }
15
16
    public function testGetByProductIdReturnsArrayOfFeatureModels()
17
    {
18
        $testMapper = $this->getTestMapper();
19
        $testMapper->insert(array('product_id' => 88), 'catalog_product_feature');
20
21
        $mapper = $this->getMapper();
22
        $return = $mapper->getByProductId(88);
23
        $this->assertTrue(is_array($return));
24
        $this->assertInstanceOf('\SpeckCatalog\Model\Feature', $return[0]);
25
    }
26
27
    public function getMapper()
28
    {
29
        return $this->getServiceManager()->get('speckcatalog_feature_mapper');
30
    }
31
}
32