1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-08-26 13:20:17 +02:00

General tests cleanup

This commit is contained in:
Jakub Turek 2015-02-22 18:14:53 +01:00
parent 3792f5fb8c
commit a91060a16f
3 changed files with 11 additions and 18 deletions

View File

@ -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();
}

View File

@ -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');

View File

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