public function testRoleCanBeDeleted() { $id = $this->tester->haveRecord('roles', ['role_name' => 'user']); $role = \ChopBox\Role::find($id); $role->delete(); $this->tester->dontSeeRecord('roles', ['role_name' => 'user']); }
public function testUploadCanBeDeleted() { $chops_id = $this->createChops(); $id = $this->tester->haveRecord('uploads', ['chops_id' => $chops_id, 'mime_type' => 'image/jpg', 'file_uri' => 'bla', 'name' => 'a name']); $upload = \ChopBox\Upload::find($id); $upload->delete(); $this->tester->dontSeeRecord('uploads', ['name' => 'a name']); }
public function testChopsCanBeUnfavourited() { $chops_id = $this->createChops(); $id = $this->tester->haveRecord('favourites', ['chops_id' => $chops_id]); $favourite = \ChopBox\Favourite::find($id); $favourite->delete(); $this->tester->dontSeeRecord('favourites', ['chops_id' => $chops_id]); }
public function testCommentCanBeDeleted() { $chops_id = $this->createChops(); $chops = \ChopBox\Chop::find($chops_id); $id = $this->tester->haveRecord('comments', ['comment' => "this comment has to be deleted", 'user_id' => $chops->user_id, 'chops_id' => $chops->id]); $comment = \ChopBox\Comment::find($id); $comment->delete(); $this->tester->dontSeeRecord('comments', ['comment' => 'this comment has to be deleted']); }
public function testChopsCanBeUpdated() { $id = $this->createChops(); $chops = Chop::find($id); $chops->chops_name = "A new name"; $chops->save(); $this->tester->seeRecord('chops', ['chops_name' => 'A new name']); $this->tester->dontSeeRecord('chops', ['chops_name' => 'Random name']); }
public function testCompleteRemovingFromDatabase() { $pm = $this->create(); $pm->delete(); // jeden rekord powinien byc w bazie danych... $this->tester->seeRecord('pm_text', ['id' => $pm->text_id]); Pm::where('root_id', $pm->root_id)->delete(); $this->tester->dontSeeRecord('pm_text', ['id' => $pm->text_id]); }
public function testAlertDelete() { $alert = $this->create(); $alert->delete(); $user = $this->tester->grabRecord('users', ['id' => $this->user->id]); $this->assertEquals(0, $user->alerts); $this->assertEquals(0, $user->alerts_unread); $this->tester->dontSeeRecord('alerts', ['object_id' => $alert->object_id]); }
public function testTopicMove() { $fake = Factory::create(); $topic = $this->create(); $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $this->forum->id])->topics); $newForum = Forum::create(['name' => $fake->name, 'path' => $fake->name, 'description' => 'Lorem ipsum']); $topic->forum_id = $newForum->id; $topic->save(); $this->assertEquals(1, $this->tester->grabRecord('forums', ['id' => $newForum->id])->topics); $this->tester->dontSeeRecord('posts', ['forum_id' => $this->forum->id]); }