Skip to content

Commit 2bd64c5

Browse files
committed
chore(cs): fix code style
1 parent 98e2bcb commit 2bd64c5

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

tests/Unit/Client/DockerApiClientWrapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class DockerApiClientWrapperTest extends Unit
1313
public function testGetDockerClient(): void
1414
{
1515
$mockClient = $this->createMock(Client::class);
16-
$wrapper = new DockerApiClientWrapper('http://localhost', '/var/run/docker.sock', $mockClient);
16+
$wrapper = new DockerApiClientWrapper('http://localhost', '/var/run/docker.sock', $mockClient);
1717

1818
$this->assertSame($mockClient, $wrapper->getDockerClient());
1919
}

tests/Unit/Service/DockerServiceTest.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Codeception\Test\Unit;
88
use PHPUnit\Framework\MockObject\MockObject;
9+
use stdClass;
910
use WebProject\DockerApi\Library\Generated\Client;
1011
use WebProject\DockerApi\Library\Generated\Model\ContainerConfig;
1112
use WebProject\DockerApi\Library\Generated\Model\ContainerInspectResponse;
@@ -24,9 +25,9 @@ final class DockerServiceTest extends Unit
2425

2526
protected function _before(): void
2627
{
27-
$this->client = $this->createMock(Client::class);
28+
$this->client = $this->createMock(Client::class);
2829
$this->apiClientWrapper = new DockerApiClientWrapper('http://mocked-uri', '/mocked/socket', $this->client);
29-
$this->service = new DockerService($this->apiClientWrapper);
30+
$this->service = new DockerService($this->apiClientWrapper);
3031
}
3132

3233
public function testFindAllContainer(): void
@@ -39,11 +40,11 @@ public function testFindAllContainer(): void
3940
->willReturn([$containerSummary]);
4041

4142
$inspectResponse = $this->createConfiguredMock(ContainerInspectResponse::class, [
42-
'getId' => '123',
43-
'getName' => '/test-container',
44-
'getImage' => 'nginx:latest',
45-
'getState' => $this->createConfiguredMock(ContainerState::class, ['getRunning' => true]),
46-
'getConfig' => $this->createConfiguredMock(ContainerConfig::class, ['getEnv' => ['FOO=bar']]),
43+
'getId' => '123',
44+
'getName' => '/test-container',
45+
'getImage' => 'nginx:latest',
46+
'getState' => $this->createConfiguredMock(ContainerState::class, ['getRunning' => true]),
47+
'getConfig' => $this->createConfiguredMock(ContainerConfig::class, ['getEnv' => ['FOO=bar']]),
4748
'getNetworkSettings' => $this->createConfiguredMock(NetworkSettings::class, ['getNetworks' => [], 'getPorts' => []]),
4849
]);
4950

@@ -53,7 +54,7 @@ public function testFindAllContainer(): void
5354
->willReturn($inspectResponse);
5455

5556
$result = $this->service->findAllContainer();
56-
$dtos = iterator_to_array($result);
57+
$dtos = iterator_to_array($result);
5758

5859
$this->assertCount(1, $dtos);
5960
$this->assertArrayHasKey('123', $dtos);
@@ -65,11 +66,11 @@ public function testFindAllContainer(): void
6566
public function testFindContainer(): void
6667
{
6768
$inspectResponse = $this->createConfiguredMock(ContainerInspectResponse::class, [
68-
'getId' => '456',
69-
'getName' => '/single-container',
70-
'getImage' => 'php:8.3',
71-
'getState' => $this->createConfiguredMock(ContainerState::class, ['getRunning' => false]),
72-
'getConfig' => $this->createConfiguredMock(ContainerConfig::class, ['getEnv' => []]),
69+
'getId' => '456',
70+
'getName' => '/single-container',
71+
'getImage' => 'php:8.3',
72+
'getState' => $this->createConfiguredMock(ContainerState::class, ['getRunning' => false]),
73+
'getConfig' => $this->createConfiguredMock(ContainerConfig::class, ['getEnv' => []]),
7374
'getNetworkSettings' => $this->createConfiguredMock(NetworkSettings::class, ['getNetworks' => [], 'getPorts' => []]),
7475
]);
7576

@@ -89,10 +90,10 @@ public function testFindContainerNotFound(): void
8990
$this->client->expects($this->once())
9091
->method('containerInspect')
9192
->with('999')
92-
->willReturn(new \stdClass());
93+
->willReturn(new stdClass());
9394

9495
$dto = $this->service->findContainer('999');
9596

9697
$this->assertNull($dto);
9798
}
98-
}
99+
}

0 commit comments

Comments
 (0)