for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EventSauce\Time;
use EventSauce\EventSourcing\PointInTime;
use PHPUnit\Framework\TestCase;
class TestClockTest extends TestCase
{
/**
* @test
*/
public function getting_back_equal_date_times()
$clock = new TestClock();
$d1 = $clock->dateTime();
$d2 = $clock->dateTime();
$this->assertEquals($d1, $d2);
}
public function ticking_the_clock_sets_it_forward()
$clock->tick();
$this->assertNotEquals($d1, $d2);
$this->assertTrue($d1 < $d2);
public function fixating_the_clock()
$clock->fixate('2017-01-01 12:00:00');
$clock->fixate('2016-01-01 12:00:00');
$this->assertTrue($d1 > $d2);
public function creating_points_in_time()
$pointInTime = $clock->pointInTime();
$this->assertInstanceOf(PointInTime::class, $pointInTime);