Пример #1
0
 public function run()
 {
     $faker = Factory::create();
     //Comment::truncate();
     foreach (range(1, 50) as $index) {
         Comment::create(['comment' => $faker->text, 'user_id' => $faker->numberBetween(1, 50), 'chop_id' => $faker->numberBetween(21, 50)]);
     }
 }
Пример #2
0
 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']);
 }