We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b960eb commit 949c0bdCopy full SHA for 949c0bd
tests/mutex/MutexConcurrencyTest.php
@@ -3,6 +3,7 @@
3
namespace malkusch\lock\mutex;
4
5
use Eloquent\Liberator\Liberator;
6
+use PHPUnit\Framework\Constraint\IsType;
7
use PHPUnit\Framework\TestCase;
8
use Predis\Client;
9
use Redis;
@@ -252,7 +253,13 @@ public function provideMutexFactories()
252
253
254
'semaphore' => [function ($timeout = 3) use ($filename): Mutex {
255
$semaphore = sem_get(ftok($filename, 'b'));
- $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
+ );
263
264
return new SemaphoreMutex($semaphore);
265
}],
0 commit comments