From e35a8a7f3a1185104b73fa7cd1ef265f0ea40d05 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Fri, 20 Feb 2015 15:56:39 +0100 Subject: [PATCH] Apply BaseTest as parent of AbstractCommandTest class --- tests/MageTest/Command/AbstractCommandTest.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/MageTest/Command/AbstractCommandTest.php b/tests/MageTest/Command/AbstractCommandTest.php index 4f7a2e1..5f77a0e 100644 --- a/tests/MageTest/Command/AbstractCommandTest.php +++ b/tests/MageTest/Command/AbstractCommandTest.php @@ -2,6 +2,7 @@ namespace MageTest\Command; use Mage\Command\AbstractCommand; +use MageTest\TestHelper\BaseTest; use PHPUnit_Framework_MockObject_MockObject; /** @@ -9,7 +10,7 @@ use PHPUnit_Framework_MockObject_MockObject; * @package MageTest\Command * @coversDefaultClass Mage\Command\AbstractCommand */ -class AbstractCommandTest extends \PHPUnit_Framework_TestCase +class AbstractCommandTest extends BaseTest { /** * @var AbstractCommand|PHPUnit_Framework_MockObject_MockObject @@ -32,11 +33,8 @@ class AbstractCommandTest extends \PHPUnit_Framework_TestCase $configMock = $this->getMock('Mage\Config'); $this->abstractCommand->setConfig($configMock); - $configProperty = new \ReflectionProperty($this->abstractCommand, 'config'); - $configProperty->setAccessible(true); - $configValue = $configProperty->getValue($this->abstractCommand); - - $this->assertEquals($configMock, $configValue); + $actual = $this->getPropertyValue($this->abstractCommand, 'config'); + $this->assertEquals($configMock, $actual); } /** @@ -45,10 +43,7 @@ class AbstractCommandTest extends \PHPUnit_Framework_TestCase public function testGetConfig() { $configMock = $this->getMock('Mage\Config'); - - $configProperty = new \ReflectionProperty($this->abstractCommand, 'config'); - $configProperty->setAccessible(true); - $configProperty->setValue($this->abstractCommand, $configMock); + $this->setPropertyValue($this->abstractCommand, 'config', $configMock); $actual = $this->abstractCommand->getConfig(); $this->assertEquals($configMock, $actual);