Skip to content

Commit 949c0bd

Browse files
Improve PHPUnit usage
1 parent 4b960eb commit 949c0bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/mutex/MutexConcurrencyTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace malkusch\lock\mutex;
44

55
use Eloquent\Liberator\Liberator;
6+
use PHPUnit\Framework\Constraint\IsType;
67
use PHPUnit\Framework\TestCase;
78
use Predis\Client;
89
use Redis;
@@ -252,7 +253,13 @@ public function provideMutexFactories()
252253

253254
'semaphore' => [function ($timeout = 3) use ($filename): Mutex {
254255
$semaphore = sem_get(ftok($filename, 'b'));
255-
$this->assertTrue($semaphore instanceof \SysvSemaphore || is_resource($semaphore)); // @phpstan-ignore-line
256+
$this->assertThat(
257+
$semaphore,
258+
$this->logicalOr(
259+
$this->isInstanceOf(\SysvSemaphore::class),
260+
new IsType(IsType::TYPE_RESOURCE)
261+
)
262+
);
256263

257264
return new SemaphoreMutex($semaphore);
258265
}],

0 commit comments

Comments
 (0)