mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 02:37:22 +01:00
feat(expectations): add file assertions
This commit is contained in:
@ -414,6 +414,36 @@ final class Expectation
|
|||||||
return $this;
|
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.
|
* Dynamically calls methods on the class without any arguments.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user