Пример #1
0
 public function test_check_if_a_tag_can_be_persisted()
 {
     $tag = Tag::create(['name' => 'Tag test']);
     $this->assertEquals('Tag test', $tag->name);
     $tag = Tag::all()->first();
     $this->assertEquals('Tag test', $tag->name);
 }
Пример #2
0
 public function testSePodeAtribuirUmPostParaUmaTag()
 {
     $tag = Tag::create(['name' => 'Tag Test']);
     $post = new Post();
     //Post::create(['title' => 'Post test']);
     $post->title = 'Post test';
     $post->content = 'Post test';
     $tag->posts()->save($post);
     $this->assertEquals('Post test', $tag->posts()->first()->title);
     // $this->assertEquals('Parent Test', $category->parent->name);
     /*$list = Todolist::find(1);
     
             $c = new Comment();
     
             $c->body = 'Great work!';*/
 }