Ouzo\TranslatableTimeAgo::create PHP 메소드

create() 공개 정적인 메소드

public static create ( $date )
    public static function create($date)
    {
        $timeAgo = new TimeAgo($date);
        return new TranslatableTimeAgo($timeAgo);
    }

Usage Example

예제 #1
0
 /**
  * @test
  * @dataProvider dates
  * @param string $currentDate
  * @param string $date
  * @param string $expectedText
  */
 public function shouldCreateTranslatableTimeAgo($currentDate, $date, $expectedText)
 {
     //given
     Clock::freeze($currentDate);
     //when
     $translatableTimeAgo = TranslatableTimeAgo::create($date)->asString();
     //then
     $this->assertEquals($expectedText, $translatableTimeAgo, 'Error in [' . $date . '] with expected [' . $expectedText . ']');
 }