Skip to content

Commit

Permalink
Fix: target normalizing
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurJCQ committed Nov 27, 2023
1 parent 7de233a commit 6e2a9bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Domain/Player/Normalizer/PlayerNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function normalize(
[
'id' => $object->getId(),
'name' => $object->getName(),
'avatar' => $object->getAvatar(),
]],
);

Expand All @@ -42,7 +43,6 @@ public function normalize(
return $normalizedPlayer;
}


$normalizedPlayer['target'] = [
'id' => $normalizedPlayer['target']['id'],
'name' => $normalizedPlayer['target']['name'],
Expand Down
2 changes: 2 additions & 0 deletions tests/Api/RoomControllerCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function testStartGameSuccessfully(ApiTester $I): void
'name' => 'Admin',
'room' => ['id' => $room->getId()],
'status' => PlayerStatus::ALIVE->value,
'target' => ['avatar' => Player::DEFAULT_AVATAR],
],
);
}
Expand Down Expand Up @@ -363,6 +364,7 @@ public function testKillAllPlayersButOne(ApiTester $I): void
'name' => 'Doe',
'status' => PlayerStatus::ALIVE->value,
'assignedMission' => ['content' => 'mission'],
'target' => ['avatar' => Player::DEFAULT_AVATAR],
]);

$I->sendPatch(sprintf('/player/%s', $player2Id), (string) json_encode(['status' => PlayerStatus::KILLED]));
Expand Down
1 change: 1 addition & 0 deletions tests/_support/Helper/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Tests\Helper;

use App\Domain\Player\Entity\Player;
use App\Tests\ApiTester;
use Codeception\Module;

Expand Down

0 comments on commit 6e2a9bc

Please sign in to comment.