|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
namespace MageTest\Command; |
|
|
|
namespace MageTest\Command; |
|
|
|
use Mage\Command\AbstractCommand; |
|
|
|
use Mage\Command\AbstractCommand; |
|
|
|
|
|
|
|
use MageTest\TestHelper\BaseTest; |
|
|
|
use PHPUnit_Framework_MockObject_MockObject; |
|
|
|
use PHPUnit_Framework_MockObject_MockObject; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -9,7 +10,7 @@ use PHPUnit_Framework_MockObject_MockObject; |
|
|
|
* @package MageTest\Command |
|
|
|
* @package MageTest\Command |
|
|
|
* @coversDefaultClass Mage\Command\AbstractCommand |
|
|
|
* @coversDefaultClass Mage\Command\AbstractCommand |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
class AbstractCommandTest extends \PHPUnit_Framework_TestCase |
|
|
|
class AbstractCommandTest extends BaseTest |
|
|
|
{ |
|
|
|
{ |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @var AbstractCommand|PHPUnit_Framework_MockObject_MockObject |
|
|
|
* @var AbstractCommand|PHPUnit_Framework_MockObject_MockObject |
|
|
@ -32,11 +33,8 @@ class AbstractCommandTest extends \PHPUnit_Framework_TestCase |
|
|
|
$configMock = $this->getMock('Mage\Config'); |
|
|
|
$configMock = $this->getMock('Mage\Config'); |
|
|
|
$this->abstractCommand->setConfig($configMock); |
|
|
|
$this->abstractCommand->setConfig($configMock); |
|
|
|
|
|
|
|
|
|
|
|
$configProperty = new \ReflectionProperty($this->abstractCommand, 'config'); |
|
|
|
$actual = $this->getPropertyValue($this->abstractCommand, 'config'); |
|
|
|
$configProperty->setAccessible(true); |
|
|
|
$this->assertEquals($configMock, $actual); |
|
|
|
$configValue = $configProperty->getValue($this->abstractCommand); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($configMock, $configValue); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -45,10 +43,7 @@ class AbstractCommandTest extends \PHPUnit_Framework_TestCase |
|
|
|
public function testGetConfig() |
|
|
|
public function testGetConfig() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$configMock = $this->getMock('Mage\Config'); |
|
|
|
$configMock = $this->getMock('Mage\Config'); |
|
|
|
|
|
|
|
$this->setPropertyValue($this->abstractCommand, 'config', $configMock); |
|
|
|
$configProperty = new \ReflectionProperty($this->abstractCommand, 'config'); |
|
|
|
|
|
|
|
$configProperty->setAccessible(true); |
|
|
|
|
|
|
|
$configProperty->setValue($this->abstractCommand, $configMock); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$actual = $this->abstractCommand->getConfig(); |
|
|
|
$actual = $this->abstractCommand->getConfig(); |
|
|
|
$this->assertEquals($configMock, $actual); |
|
|
|
$this->assertEquals($configMock, $actual); |
|
|
|