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); }
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!';*/ }