コード例 #1
0
ファイル: SegmentTest.php プロジェクト: Maksold/platform
 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());
 }