diff --git a/src/Expectation.php b/src/Expectation.php index 0770e367..4e5b9633 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -414,6 +414,36 @@ final class Expectation return $this; } + /** + * Asserts that the value is a file. + */ + public function toBeFile(): Expectation + { + Assert::assertFileExists($this->value); + + return $this; + } + + /** + * Asserts that the value is a file and is readable. + */ + public function toBeReadableFile(): Expectation + { + Assert::assertFileIsReadable($this->value); + + return $this; + } + + /** + * Asserts that the value is a file and is writable. + */ + public function toBeWritableFile(): Expectation + { + Assert::assertFileIsWritable($this->value); + + return $this; + } + /** * Dynamically calls methods on the class without any arguments. *