assertFalse("it's not mohammad's fault, I'm waiting for dynamic policy"); // } public function test_user_update_not_exits_files_not_found() { $data = [ "original_name" => 'original name is very bad', "description" => 'this is a description for file and has beed updated', ]; $response = $this->loginAs()->putJson(route('api.files.update', ['collection_name' => 'not_exits', 'uuid' => app()->uuid, 'extention' => 'jpg']), $data); $response->assertNotFound(); } public function test_user_can_update_file() { $file = $this->one(File::class, dependencyAttributes: ['withImage' => true]); $collection = Collection::find($file->collection_id); $data = [ "original_name" => 'original name is very bad', "description" => 'this is a description for file and has beed updated', ]; $response = $this->loginAs()->putJson(route('api.files.update', ['collection_name' => $collection->name, 'uuid' => $file->uuid, 'extention' => $collection->ext]), $data); $response->assertok()->assertJson(['data' => $data]); } }