Skip to content

Commit

Permalink
[Tests/GreeterTest] 時計オブジェクトのモックを用意しSUTで利用するようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Oct 9, 2013
1 parent 19656da commit a0d58b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/CodeIQ/Greeter/Tests/GreeterTest.php
Expand Up @@ -2,6 +2,7 @@

namespace CodeIQ\Greeter\Tests;

use CodeIQ\Greeter\Clock;
use CodeIQ\Greeter\Greeter;

class GreeterTest extends \PHPUnit_Framework_TestCase
Expand All @@ -10,6 +11,10 @@ class GreeterTest extends \PHPUnit_Framework_TestCase
* @var Greeter
*/
public $SUT;
/**
* @var Clock
*/
private $clock;

/**
* @test
Expand All @@ -21,6 +26,7 @@ public function あいさつする()

protected function setUp()
{
$this->SUT = new Greeter;
$this->clock = $this->getMock('CodeIQ\Greeter\Clock');
$this->SUT = new Greeter($this->clock);
}
}

0 comments on commit a0d58b6

Please sign in to comment.