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

testShouldGetAnAttributeModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 16
rs 9.4286
cc 1
eloc 11
nc 1
nop 0
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