Skip to content

Commit 45be91d

Browse files
committed
test: remove usage of withConsecutive
1 parent c6721cb commit 45be91d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/Providers/TypeMapperServiceProviderTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ public function itRegistersTypesWithTheTypeMapper()
2121
$typeMapper = $this->createMock(TypeMapper::class);
2222
$typeMapper->expects($this->exactly(2))
2323
->method('setMapping')
24-
->withConsecutive(
25-
['child', ChildItem::class],
26-
['parent', ParentItem::class]
27-
);
24+
->willReturnCallback(function (string $type, string $class) {
25+
static $i = 0;
26+
switch (++$i) {
27+
case 1:
28+
$this->assertEquals('child', $type);
29+
$this->assertEquals(ChildItem::class, $class);
30+
break;
31+
case 2:
32+
$this->assertEquals('parent', $type);
33+
$this->assertEquals(ParentItem::class, $class);
34+
break;
35+
}
36+
});
2837

2938
$provider->boot($typeMapper);
3039
}

0 commit comments

Comments
 (0)