feat(expectations): add file assertions

This commit is contained in:
Owen Voke
2020-08-12 12:24:00 +01:00
parent cfe6a6728f
commit 50cd1056eb

View File

@ -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.
*