Completed
Pull Request — develop (#169)
by Robbie
10:34 queued 06:01
created

AbstractAttributeCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testShouldGetAnAttributeModel() 0 16 1
1
<?php
2
3
namespace N98\Magento\Command\Eav\Attribute;
4
5
use N98\Magento\Command\PHPUnit\TestCase;
6
7
class AbstractAttributeCommandTest extends TestCase
8
{
9
    /**
10
     * Ensure that the getAttribute() method returns a Magento EAV attribute model
11
     */
12
    public function testShouldGetAnAttributeModel()
13
    {
14
        $mock = $this->getMockBuilder(AbstractAttributeCommand::class)
15
            ->disableOriginalConstructor()
16
            ->setMethods(array('getApplication'))
17
            ->getMockForAbstractClass();
18
19
        $mock
20
            ->expects($this->once())
21
            ->method('getApplication')
22
            ->will($this->returnValue($this->getApplication()));
23
24
        $result = $mock->getAttribute('catalog_product', 'status');
25
        
26
        $this->assertInstanceOf('\Magento\Eav\Model\Entity\Attribute\AbstractAttribute', $result);
27
    }
28
}
29