Browse Source

General tests cleanup

1.0
Jakub Turek 10 years ago
parent
commit
a91060a16f
  1. 12
      tests/MageTest/Command/BuiltIn/CompileCommandTest.php
  2. 16
      tests/MageTest/Command/BuiltIn/ListCommandTest.php
  3. 1
      tests/MageTest/Command/BuiltIn/UnlockCommandTest.php

12
tests/MageTest/Command/BuiltIn/CompileCommandTest.php

@ -31,12 +31,6 @@ class CompileCommandTest extends BaseTest
*/ */
private $iniGetValue; private $iniGetValue;
/**
* @var Mock
*/
private $iniGetMock;
/** /**
* @before * @before
*/ */
@ -46,12 +40,12 @@ class CompileCommandTest extends BaseTest
$this->iniGetValue = new FixedValueFunction(); $this->iniGetValue = new FixedValueFunction();
$mockBuilder = new MockBuilder(); $mockBuilder = new MockBuilder();
$this->iniGetMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') $iniGetMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn')
->setName("ini_get") ->setName("ini_get")
->setCallableProvider($this->iniGetValue) ->setCallableProvider($this->iniGetValue)
->build(); ->build();
$this->iniGetMock->disable(); $iniGetMock->disable();
$this->iniGetMock->enable(); $iniGetMock->enable();
$this->setUpConsoleStatics(); $this->setUpConsoleStatics();
} }

16
tests/MageTest/Command/BuiltIn/ListCommandTest.php

@ -26,11 +26,6 @@ class ListCommandTest extends BaseTest
*/ */
private $listCommand; private $listCommand;
/**
* @var Mock
*/
private $scandirMock;
/** /**
* @var FixedValueFunction * @var FixedValueFunction
*/ */
@ -45,12 +40,12 @@ class ListCommandTest extends BaseTest
$this->scandirValueObj = new FixedValueFunction(); $this->scandirValueObj = new FixedValueFunction();
$mockBuilder = new MockBuilder(); $mockBuilder = new MockBuilder();
$this->scandirMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn') $scandirMock = $mockBuilder->setNamespace('Mage\Command\BuiltIn')
->setName("scandir") ->setName("scandir")
->setCallableProvider($this->scandirValueObj) ->setCallableProvider($this->scandirValueObj)
->build(); ->build();
$this->scandirMock->disable(); $scandirMock->disable();
$this->scandirMock->enable(); $scandirMock->enable();
$this->setUpConsoleStatics(); $this->setUpConsoleStatics();
} }
@ -128,6 +123,11 @@ class ListCommandTest extends BaseTest
$this->assertEquals($expectedExitCode, $actualExitCode); $this->assertEquals($expectedExitCode, $actualExitCode);
} }
/**
* Stub Config::getArgument to return desired value
*
* @param String $argumentValue Input argument
*/
private function mockInputArgument($argumentValue) private function mockInputArgument($argumentValue)
{ {
$configMock = $this->getMock('Mage\Config'); $configMock = $this->getMock('Mage\Config');

1
tests/MageTest/Command/BuiltIn/UnlockCommandTest.php

@ -72,7 +72,6 @@ class UnlockCommandTest extends BaseTest
$unlinkMock->disable(); $unlinkMock->disable();
$getCwdMock->disable(); $getCwdMock->disable();
$fileExistsMock->enable(); $fileExistsMock->enable();
$unlinkMock->enable(); $unlinkMock->enable();
$getCwdMock->enable(); $getCwdMock->enable();

Loading…
Cancel
Save