/** * @test */ public function delete_tag() { $tag = Tag::create(['name' => '9 Ball']); $this->assertEquals(1, Tag::count()); $tag->delete(); $this->assertEquals(0, Tag::count()); }
/** * @test */ public function add_new_tag() { $this->post->tag('new TaG'); $this->assertEquals('new tag', $this->post->tagNames); $this->assertEquals(['new tag'], $this->post->tagArray); $this->assertEquals(1, $this->post->tags->count()); $this->assertEquals(4, Tag::count()); }