コード例 #1
0
ファイル: NodeTest.php プロジェクト: NuclearCMS/Hierarchy
 /** @test */
 function it_sets_published_date_if_it_is_empty_on_creation()
 {
     $node = $this->getNode();
     $this->assertInstanceOf('Carbon\\Carbon', $node->published_at);
     $node = new Node();
     $node->setNodeTypeKey(1);
     $yesterday = Carbon\Carbon::yesterday();
     $node->published_at = $yesterday;
     $node->save();
     $this->assertEquals($node->published_at->timestamp, $yesterday->timestamp);
 }