public function testNewRecordWithNewReferenced() { $page = Page::create(array("name" => "English article", "description" => "Description", "text" => "Text in english.", "allowed" => true)); $page->Tags[] = Tag::create(array("name" => "Society", "url" => "society")); $page->Tags[] = Tag::create(array("name" => "Previte", "url" => "previte")); $page->save(); $this->assertEquals(2, count(Page::findByName("English article")->Tags)); }
public function testNewRecordWithNewReferenced() { $page = Page::create(array("name" => "English article", "description" => "Description", "text" => "Text in english.", "allowed" => true)); $page->Comments[] = Comment::create(array("text" => "muj názor", "name" => "Honza", "mail" => "*****@*****.**")); $page->Comments[] = Comment::create(array("text" => "muj jiný názor", "name" => "Honza", "mail" => "*****@*****.**")); $page->save(); $this->assertEquals(2, count(Page::findByName("English article")->Comments)); }