mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: adds toHaveFileSystemPermissions expectation
This commit is contained in:
16
tests/Features/Expect/toHaveFileSystemPermissions.php
Normal file
16
tests/Features/Expect/toHaveFileSystemPermissions.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect(Pest\Preset::class)->toHaveFileSystemPermissions('0644')
|
||||
->and('Pest')->not->toHaveFileSystemPermissions('0777');
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(Pest\Preset::class)->toHaveFileSystemPermissions('0755');
|
||||
})->throws(ArchExpectationFailedException::class, "Expecting 'src/Preset.php' permissions to be [0755].");
|
||||
|
||||
test('not failures', function () {
|
||||
expect(Pest\Preset::class)->not->toHaveFileSystemPermissions('0644');
|
||||
})->throws(ArchExpectationFailedException::class, "Expecting 'src/Preset.php' permissions not to be [0644].");
|
||||
Reference in New Issue
Block a user