mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat: adds toHaveFileSystemPermissions expectation
This commit is contained in:
@ -741,6 +741,11 @@
|
||||
✓ class has destructor
|
||||
✓ class has no destructor
|
||||
|
||||
PASS Tests\Features\Expect\toHaveFileSystemPermissions
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Features\Expect\toHaveKebabCaseKeys
|
||||
✓ pass
|
||||
✓ failures
|
||||
@ -1516,4 +1521,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1063 passed (2602 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1066 passed (2611 assertions)
|
||||
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].");
|
||||
@ -16,7 +16,7 @@ $run = function () {
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run('--exclude-group=integration'))
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1049 passed (2570 assertions)')
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1052 passed (2579 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user