Skip to content

Commit

Permalink
テストで時計オブジェクトのモックを使う準備 [PASS]
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Jul 23, 2018
1 parent 9f4e2c9 commit ebe1cba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/GreeterTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Hg\Greeter\Tests;

use Hg\Greeter\Clock;
use Hg\Greeter\Greeter;
use PHPUnit\Framework\TestCase;

Expand All @@ -10,6 +11,10 @@ class GreeterTest extends 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->getMockBuilder(Clock::class)->getMock();
$this->SUT = new Greeter($this->clock);
}
}

0 comments on commit ebe1cba

Please sign in to comment.