Skip to content

Commit

Permalink
Add missing file creation to lock cases in StreamWrapperTest
Browse files Browse the repository at this point in the history
  • Loading branch information
elazar committed Aug 15, 2024
1 parent 0a18317 commit 2d3a396
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/StreamWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ function createFile(string $uri): void
});

it('can acquire multiple shared locks', function () {
createFile('fly://foo');

$stream1 = fopen('fly://foo', 'r');
$result = flock($stream1, LOCK_SH);
expect($result)->toBeTrue();
Expand Down Expand Up @@ -156,6 +158,8 @@ function createFile(string $uri): void
});

it('cannot acquire an exclusive lock with existing locks', function () {
createFile('fly://foo');

$stream1 = fopen('fly://foo', 'r');
$result = flock($stream1, LOCK_SH);
expect($result)->toBeTrue();
Expand Down

0 comments on commit 2d3a396

Please sign in to comment.