Exemplo n.º 1
0
 public function testWithoutTimezoneAndLanguage()
 {
     $date = new DateTime('-6 seconds');
     $humanDate = new HumanDate();
     $formattedDate = $humanDate->format($date);
     $expectedDate = '6 seconds ago';
     $this->assertEquals($expectedDate, $formattedDate);
 }
Exemplo n.º 2
0
 /**
  * @test
  * @covers Cocur\HumanDate\Bridge\Twig\HumanDateExtension::slugifyFilter()
  */
 public function slugifyFilter()
 {
     $this->humanDate->shouldReceive('transform')->with('2014-05-14')->once()->andReturn('Today');
     $this->assertEquals('Today', $this->extension->humanDateFilter('2014-05-14'));
 }