File tree Expand file tree Collapse file tree 3 files changed +21
-26
lines changed Expand file tree Collapse file tree 3 files changed +21
-26
lines changed Original file line number Diff line number Diff line change 1- <?php
1+ <?php /** @noinspection PhpUnhandledExceptionInspection */
22
33/**
44 * PHP Mutex implementation.
@@ -26,6 +26,6 @@ public function create(): void
2626 {
2727 $ mutex = (new InMemoryMutexFactory ())->create (__CLASS__ );
2828
29- static ::assertInstanceOf (InMemoryMutex::class, $ mutex );
29+ self ::assertInstanceOf (InMemoryMutex::class, $ mutex );
3030 }
3131}
Original file line number Diff line number Diff line change 1- <?php
1+ <?php /** @noinspection PhpUnhandledExceptionInspection */
22
33/**
44 * PHP Mutex implementation.
2323 */
2424final class InMemoryMutexTest extends TestCase
2525{
26- /**
27- * {@inheritdoc}
28- */
2926 protected function tearDown (): void
3027 {
3128 parent ::tearDown ();
3229
3330 InMemoryMutexStorage::instance ()->reset ();
3431 }
3532
36- /** @test */
33+ /**
34+ * @test
35+ */
3736 public function acquire (): void
3837 {
3938 Loop::run (
@@ -42,17 +41,17 @@ static function (): \Generator
4241 $ mutex = new InMemoryMutex (__CLASS__ );
4342 $ promise = $ mutex ->acquire ();
4443
45- static ::assertTrue (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
44+ self ::assertTrue (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
4645
4746 /** @var Lock $lock */
4847 $ lock = yield $ promise ;
4948
5049 yield $ lock ->release ();
5150
52- static ::assertFalse (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
51+ self ::assertFalse (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
5352
54- static ::assertSame (__CLASS__ , $ lock ->id ());
55- static ::assertTrue ($ lock ->released ());
53+ self ::assertSame (__CLASS__ , $ lock ->id ());
54+ self ::assertTrue ($ lock ->released ());
5655
5756 Loop::stop ();
5857 }
Original file line number Diff line number Diff line change 1- <?php
1+ <?php /** @noinspection PhpUnhandledExceptionInspection */
22
33/**
44 * PHP Mutex implementation.
1818use Amp \Redis \RemoteExecutor ;
1919use PHPUnit \Framework \TestCase ;
2020use ServiceBus \Mutex \Lock ;
21- use ServiceBus \Mutex \Redis \RedisMutex ;
2221use ServiceBus \Mutex \Redis \RedisMutexFactory ;
23- use function Amp \delay ;
2422
2523/**
2624 *
2725 */
2826final class RedisMutexTest extends TestCase
2927{
30- /** @var Redis */
31- private $ client ;
32-
3328 /**
34- * @inheritDoc
29+ * @var Redis
3530 */
31+ private $ client ;
32+
3633 protected function setUp (): void
3734 {
3835 parent ::setUp ();
@@ -44,17 +41,16 @@ protected function setUp(): void
4441 );
4542 }
4643
47- /**
48- * @inheritDoc
49- */
5044 protected function tearDown (): void
5145 {
5246 parent ::tearDown ();
5347
5448 unset($ this ->client );
5549 }
5650
57- /** @test */
51+ /**
52+ * @test
53+ */
5854 public function acquire (): void
5955 {
6056 Loop::run (
@@ -68,17 +64,17 @@ function (): \Generator
6864 /** @var bool $has */
6965 $ has = yield $ this ->client ->has (__CLASS__ );
7066
71- static ::assertTrue ($ has );
67+ self ::assertTrue ($ has );
7268
7369 yield $ lock ->release ();
7470
7571 /** @var bool $has */
7672 $ has = yield $ this ->client ->has (__CLASS__ );
7773
78- static ::assertFalse ($ has );
74+ self ::assertFalse ($ has );
7975
80- static ::assertSame (__CLASS__ , $ lock ->id ());
81- static ::assertTrue ($ lock ->released ());
76+ self ::assertSame (__CLASS__ , $ lock ->id ());
77+ self ::assertTrue ($ lock ->released ());
8278
8379 Loop::stop ();
8480 }
You can’t perform that action at this time.
0 commit comments