File tree 3 files changed +21
-26
lines changed
3 files changed +21
-26
lines changed Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php /** @noinspection PhpUnhandledExceptionInspection */
2
2
3
3
/**
4
4
* PHP Mutex implementation.
@@ -26,6 +26,6 @@ public function create(): void
26
26
{
27
27
$ mutex = (new InMemoryMutexFactory ())->create (__CLASS__ );
28
28
29
- static ::assertInstanceOf (InMemoryMutex::class, $ mutex );
29
+ self ::assertInstanceOf (InMemoryMutex::class, $ mutex );
30
30
}
31
31
}
Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php /** @noinspection PhpUnhandledExceptionInspection */
2
2
3
3
/**
4
4
* PHP Mutex implementation.
23
23
*/
24
24
final class InMemoryMutexTest extends TestCase
25
25
{
26
- /**
27
- * {@inheritdoc}
28
- */
29
26
protected function tearDown (): void
30
27
{
31
28
parent ::tearDown ();
32
29
33
30
InMemoryMutexStorage::instance ()->reset ();
34
31
}
35
32
36
- /** @test */
33
+ /**
34
+ * @test
35
+ */
37
36
public function acquire (): void
38
37
{
39
38
Loop::run (
@@ -42,17 +41,17 @@ static function (): \Generator
42
41
$ mutex = new InMemoryMutex (__CLASS__ );
43
42
$ promise = $ mutex ->acquire ();
44
43
45
- static ::assertTrue (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
44
+ self ::assertTrue (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
46
45
47
46
/** @var Lock $lock */
48
47
$ lock = yield $ promise ;
49
48
50
49
yield $ lock ->release ();
51
50
52
- static ::assertFalse (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
51
+ self ::assertFalse (InMemoryMutexStorage::instance ()->has (__CLASS__ ));
53
52
54
- static ::assertSame (__CLASS__ , $ lock ->id ());
55
- static ::assertTrue ($ lock ->released ());
53
+ self ::assertSame (__CLASS__ , $ lock ->id ());
54
+ self ::assertTrue ($ lock ->released ());
56
55
57
56
Loop::stop ();
58
57
}
Original file line number Diff line number Diff line change 1
- <?php
1
+ <?php /** @noinspection PhpUnhandledExceptionInspection */
2
2
3
3
/**
4
4
* PHP Mutex implementation.
18
18
use Amp \Redis \RemoteExecutor ;
19
19
use PHPUnit \Framework \TestCase ;
20
20
use ServiceBus \Mutex \Lock ;
21
- use ServiceBus \Mutex \Redis \RedisMutex ;
22
21
use ServiceBus \Mutex \Redis \RedisMutexFactory ;
23
- use function Amp \delay ;
24
22
25
23
/**
26
24
*
27
25
*/
28
26
final class RedisMutexTest extends TestCase
29
27
{
30
- /** @var Redis */
31
- private $ client ;
32
-
33
28
/**
34
- * @inheritDoc
29
+ * @var Redis
35
30
*/
31
+ private $ client ;
32
+
36
33
protected function setUp (): void
37
34
{
38
35
parent ::setUp ();
@@ -44,17 +41,16 @@ protected function setUp(): void
44
41
);
45
42
}
46
43
47
- /**
48
- * @inheritDoc
49
- */
50
44
protected function tearDown (): void
51
45
{
52
46
parent ::tearDown ();
53
47
54
48
unset($ this ->client );
55
49
}
56
50
57
- /** @test */
51
+ /**
52
+ * @test
53
+ */
58
54
public function acquire (): void
59
55
{
60
56
Loop::run (
@@ -68,17 +64,17 @@ function (): \Generator
68
64
/** @var bool $has */
69
65
$ has = yield $ this ->client ->has (__CLASS__ );
70
66
71
- static ::assertTrue ($ has );
67
+ self ::assertTrue ($ has );
72
68
73
69
yield $ lock ->release ();
74
70
75
71
/** @var bool $has */
76
72
$ has = yield $ this ->client ->has (__CLASS__ );
77
73
78
- static ::assertFalse ($ has );
74
+ self ::assertFalse ($ has );
79
75
80
- static ::assertSame (__CLASS__ , $ lock ->id ());
81
- static ::assertTrue ($ lock ->released ());
76
+ self ::assertSame (__CLASS__ , $ lock ->id ());
77
+ self ::assertTrue ($ lock ->released ());
82
78
83
79
Loop::stop ();
84
80
}
You can’t perform that action at this time.
0 commit comments