public function run() { $faker = Factory::create(); Upload::truncate(); foreach (range(1, 50) as $index) { Upload::create(['name' => $faker->name, 'file_uri' => $faker->imageUrl(), 'chop_id' => $faker->numberBetween(1, 50), 'mime_type' => 'image/jpeg']); } }
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']); }