예제 #1
0
 public function testLifecycleCallbacks()
 {
     $segment = new Segment();
     $segment->beforeSave();
     $this->assertInstanceOf('\\DateTime', $segment->getCreatedAt());
     $this->assertInstanceOf('\\DateTime', $segment->getUpdatedAt());
     $this->assertEquals($segment->getCreatedAt(), $segment->getUpdatedAt());
     $segment = new Segment();
     $segment->doUpdate();
     $this->assertEmpty($segment->getCreatedAt());
     $this->assertInstanceOf('\\DateTime', $segment->getUpdatedAt());
 }