FactoryGirl\Tests\Provider\Doctrine\Fixtures\TimeTest::testGetTimePast PHP Method

testGetTimePast() public method

public testGetTimePast ( )
    public function testGetTimePast()
    {
        $time = new \DateTime();
        $interval = new \DateInterval('P3Y1M2D');
        $interval->invert = 1;
        $time->add($interval);
        $this->assertEquals($time->getTimestamp(), FieldDef::past()->days(2)->months(1)->years(3)->get(), 'Error getting unix timestamp');
        $this->assertEquals($time, FieldDef::past()->days(2)->months(1)->years(3)->get(DateIntervalHelper::DATE_TIME), 'Error getting date time');
        $this->assertEquals($time->format('d-m-y'), FieldDef::past()->days(2)->months(1)->years(3)->get(DateIntervalHelper::DATE_STRING), 'Error getting string');
    }