Skip to content

Commit fa7a6f7

Browse files
author
Masiukevich Maksim
committed
code style
1 parent e347f81 commit fa7a6f7

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

tests/InMemory/InMemoryMutexFactoryTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
}

tests/InMemory/InMemoryMutexTest.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php /** @noinspection PhpUnhandledExceptionInspection */
22

33
/**
44
* PHP Mutex implementation.
@@ -23,17 +23,16 @@
2323
*/
2424
final 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
}

tests/Redis/RedisMutexTest.php

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php /** @noinspection PhpUnhandledExceptionInspection */
22

33
/**
44
* PHP Mutex implementation.
@@ -18,21 +18,18 @@
1818
use Amp\Redis\RemoteExecutor;
1919
use PHPUnit\Framework\TestCase;
2020
use ServiceBus\Mutex\Lock;
21-
use ServiceBus\Mutex\Redis\RedisMutex;
2221
use ServiceBus\Mutex\Redis\RedisMutexFactory;
23-
use function Amp\delay;
2422

2523
/**
2624
*
2725
*/
2826
final 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
}

0 commit comments

Comments
 (0)