From 3f02ebcfe4a2878d46103d7e19ee11a2b756675e Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Sun, 8 Mar 2015 21:22:12 +0100 Subject: [PATCH] Add more restrictly tests for constructor --- .../Command/BuiltIn/CompileCommandTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/MageTest/Command/BuiltIn/CompileCommandTest.php b/tests/MageTest/Command/BuiltIn/CompileCommandTest.php index f19dafa..44b4486 100644 --- a/tests/MageTest/Command/BuiltIn/CompileCommandTest.php +++ b/tests/MageTest/Command/BuiltIn/CompileCommandTest.php @@ -46,10 +46,13 @@ class CompileCommandTest extends BaseTest */ public function testConstruct() { - $compileCommand = $this->getRawCompileCommand(); + $compilerMock = $this->getMock('Mage\Compiler'); + $compileCommand = new CompileCommand($compilerMock); + $compilerProperty = $this->getPropertyValue($compileCommand, 'compiler'); $this->assertInstanceOf('Mage\Compiler', $compilerProperty); + $this->assertSame($compilerMock, $compilerProperty); } /** @@ -96,15 +99,10 @@ class CompileCommandTest extends BaseTest $this->expectOutputString($expectedOutput); $this->iniGetValue->setValue(true); - $compileCommand = $this->getRawCompileCommand(); + $compilerMock = $this->getMock('Mage\Compiler'); + $compileCommand = new CompileCommand($compilerMock); $actualExitCode = $compileCommand->run(); $this->assertEquals($expectedExitCode, $actualExitCode); } - - private function getRawCompileCommand() - { - $compilerMock = $this->getMock('Mage\Compiler'); - return new CompileCommand($compilerMock); - } }