Skip to content

Commit 84b1db7

Browse files
committed
Test EntityID too
1 parent 3cd54ca commit 84b1db7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/UtilityTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,22 @@ public function getEntity(): object
5656
public function testModelToId(): void
5757
{
5858
$input = [
59-
'entity' => new class() implements Model {
59+
3 => new stdClass(),
60+
'model' => new class() implements Model {
6061
public function getId(): ?int
6162
{
6263
return 123456;
6364
}
6465
},
6566
4 => 1,
67+
'entityId' => new EntityID(_em(), User::class, '456'),
6668
];
6769

6870
$actual = Utility::modelToId($input);
6971

7072
$expected = $input;
71-
$expected['entity'] = 123456;
73+
$expected['model'] = 123456;
74+
$expected['entityId'] = '456';
7275

7376
self::assertSame($expected, $actual, 'models must be replaced by their ids, other values should be preserved');
7477
}

0 commit comments

Comments
 (0)