From b7dbae8ff2655a4b1b97a1bf33d6342299d396d3 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Thu, 19 Feb 2015 21:34:30 +0100 Subject: [PATCH] Abstract command tests --- .../MageTest/Command/AbstractCommandTest.php | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tests/MageTest/Command/AbstractCommandTest.php diff --git a/tests/MageTest/Command/AbstractCommandTest.php b/tests/MageTest/Command/AbstractCommandTest.php new file mode 100644 index 0000000..4f7a2e1 --- /dev/null +++ b/tests/MageTest/Command/AbstractCommandTest.php @@ -0,0 +1,56 @@ +abstractCommand = $this->getMockForAbstractClass('Mage\Command\AbstractCommand'); + } + + /** + * @covers ::setConfig + */ + public function testSetConfig() + { + $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); + } + + /** + * @covers ::getConfig + */ + public function testGetConfig() + { + $configMock = $this->getMock('Mage\Config'); + + $configProperty = new \ReflectionProperty($this->abstractCommand, 'config'); + $configProperty->setAccessible(true); + $configProperty->setValue($this->abstractCommand, $configMock); + + $actual = $this->abstractCommand->getConfig(); + $this->assertEquals($configMock, $actual); + } +}