CS Fixer
This commit is contained in:
@@ -56,7 +56,7 @@ final class CountFollowersQueryHandlerTest extends TestCase
|
||||
)
|
||||
);
|
||||
|
||||
$expectedReponse = new CountFollowersResponse(
|
||||
$expectedResponse = new CountFollowersResponse(
|
||||
authorId: $authorId,
|
||||
authorUsername: $authorUsername,
|
||||
numberOfFollowers: $authorFollowers
|
||||
@@ -67,23 +67,23 @@ final class CountFollowersQueryHandlerTest extends TestCase
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
$expectedReponse->authorId(),
|
||||
$expectedResponse->authorId(),
|
||||
$actualResponse->authorId()
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
$expectedReponse->authorUsername(),
|
||||
$expectedResponse->authorUsername(),
|
||||
$actualResponse->authorUsername()
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
$expectedReponse->numberOfFollowers(),
|
||||
$expectedResponse->numberOfFollowers(),
|
||||
$actualResponse->numberOfFollowers()
|
||||
);
|
||||
|
||||
// In PHPUnit, there is also the chance to
|
||||
// compare the whole content of the object
|
||||
// $this->assertEquals($expectedReponse, $actualResponse);
|
||||
// $this->assertEquals($expectedResponse, $actualResponse);
|
||||
}
|
||||
|
||||
private function buildRedisMockReturning($fakeReturn): Redis
|
||||
|
||||
@@ -54,16 +54,14 @@ final class CountFollowersProjectionHandlerTest extends TestCase
|
||||
$redisMock = $this->createMock(\Redis::class);
|
||||
$redisMock
|
||||
->expects($this->once())
|
||||
->method('set')
|
||||
->method('hmset')
|
||||
->with(
|
||||
'author_followers_counter_projection:'.$authorId,
|
||||
json_encode(
|
||||
[
|
||||
'id' => $authorId,
|
||||
'username' => $authorUsername,
|
||||
'followers' => $authorFollowers,
|
||||
]
|
||||
)
|
||||
'author_followers_counter_projection:'.$authorId,
|
||||
[
|
||||
'id' => $authorId,
|
||||
'username' => $authorUsername,
|
||||
'followers' => $authorFollowers,
|
||||
]
|
||||
)
|
||||
;
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ final class CountFollowersProjectionHandlerTest extends TestCase
|
||||
$redisMock = $this->createMock(\Redis::class);
|
||||
$redisMock
|
||||
->expects($this->once())
|
||||
->method('set')
|
||||
->with($redisKey, json_encode($redisRecord));
|
||||
->method('hmset')
|
||||
->with($redisKey, $redisRecord);
|
||||
|
||||
$dbMock = $this->buildEntityManagerMockReturning($redisRecord);
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ final class CreateFollowersCounterProjectionHandlerTest extends TestCase
|
||||
$redisMock = $this->createMock(\Redis::class);
|
||||
$redisMock
|
||||
->expects($this->once())
|
||||
->method('set')
|
||||
->with($redisKey, json_encode($redisRecord));
|
||||
->method('hmset')
|
||||
->with($redisKey, $redisRecord);
|
||||
|
||||
$handler = new CreateFollowersCounterProjectionHandler(
|
||||
$redisMock,
|
||||
|
||||
Reference in New Issue
Block a user