faker->word()); $file = File::fake()->create($this->faker->word()); $path = $fs->putFile($this->faker->word(), $file); $attribute = $this->faker->word(); $validator = Validator::make( [$attribute => $path], [$attribute => new StorageFileDirectoryExistsRule($fs)] ); static::assertTrue($validator->passes()); } /** * The Storage File Directory Exists Rule shall return false if the directory does not exist in the filesystem. * * @return void */ public function testFailsIfDirectoryDoesNotExist(): void { $fs = Storage::fake($this->faker->word()); $attribute = $this->faker->word(); $validator = Validator::make( [$attribute => $this->faker->filePath()], [$attribute => new StorageFileDirectoryExistsRule($fs)] ); static::assertFalse($validator->passes()); } }