From a91060a16ffd159654614cc19a6dba73386cc7e7 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Sun, 22 Feb 2015 18:14:53 +0100 Subject: [PATCH] General tests cleanup --- .../Command/BuiltIn/CompileCommandTest.php | 12 +++--------- .../MageTest/Command/BuiltIn/ListCommandTest.php | 16 ++++++++-------- .../Command/BuiltIn/UnlockCommandTest.php | 1 - 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/tests/MageTest/Command/BuiltIn/CompileCommandTest.php b/tests/MageTest/Command/BuiltIn/CompileCommandTest.php index ebada1f..9127833 100644 --- a/tests/MageTest/Command/BuiltIn/CompileCommandTest.php +++ b/tests/MageTest/Command/BuiltIn/CompileCommandTest.php @@ -31,12 +31,6 @@ class CompileCommandTest extends BaseTest */ private $iniGetValue; - /** - * @var Mock - */ - private $iniGetMock; - - /** * @before */ @@ -46,12 +40,12 @@ class CompileCommandTest extends BaseTest $this->iniGetValue = new FixedValueFunction(); $mockBuilder = new MockBuilder(); - $this->iniGetMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') + $iniGetMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') ->setName("ini_get") ->setCallableProvider($this->iniGetValue) ->build(); - $this->iniGetMock->disable(); - $this->iniGetMock->enable(); + $iniGetMock->disable(); + $iniGetMock->enable(); $this->setUpConsoleStatics(); } diff --git a/tests/MageTest/Command/BuiltIn/ListCommandTest.php b/tests/MageTest/Command/BuiltIn/ListCommandTest.php index 19fc78f..4d193e1 100644 --- a/tests/MageTest/Command/BuiltIn/ListCommandTest.php +++ b/tests/MageTest/Command/BuiltIn/ListCommandTest.php @@ -26,11 +26,6 @@ class ListCommandTest extends BaseTest */ private $listCommand; - /** - * @var Mock - */ - private $scandirMock; - /** * @var FixedValueFunction */ @@ -45,12 +40,12 @@ class ListCommandTest extends BaseTest $this->scandirValueObj = new FixedValueFunction(); $mockBuilder = new MockBuilder(); - $this->scandirMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') + $scandirMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') ->setName("scandir") ->setCallableProvider($this->scandirValueObj) ->build(); - $this->scandirMock->disable(); - $this->scandirMock->enable(); + $scandirMock->disable(); + $scandirMock->enable(); $this->setUpConsoleStatics(); } @@ -128,6 +123,11 @@ class ListCommandTest extends BaseTest $this->assertEquals($expectedExitCode, $actualExitCode); } + /** + * Stub Config::getArgument to return desired value + * + * @param String $argumentValue Input argument + */ private function mockInputArgument($argumentValue) { $configMock = $this->getMock('Mage\Config'); diff --git a/tests/MageTest/Command/BuiltIn/UnlockCommandTest.php b/tests/MageTest/Command/BuiltIn/UnlockCommandTest.php index bd7ec91..8d92ced 100644 --- a/tests/MageTest/Command/BuiltIn/UnlockCommandTest.php +++ b/tests/MageTest/Command/BuiltIn/UnlockCommandTest.php @@ -72,7 +72,6 @@ class UnlockCommandTest extends BaseTest $unlinkMock->disable(); $getCwdMock->disable(); - $fileExistsMock->enable(); $unlinkMock->enable(); $getCwdMock->enable();