We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6721cb commit 45be91dCopy full SHA for 45be91d
tests/Providers/TypeMapperServiceProviderTest.php
@@ -21,10 +21,19 @@ public function itRegistersTypesWithTheTypeMapper()
21
$typeMapper = $this->createMock(TypeMapper::class);
22
$typeMapper->expects($this->exactly(2))
23
->method('setMapping')
24
- ->withConsecutive(
25
- ['child', ChildItem::class],
26
- ['parent', ParentItem::class]
27
- );
+ ->willReturnCallback(function (string $type, string $class) {
+ static $i = 0;
+ switch (++$i) {
+ 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
35
+ }
36
+ });
37
38
$provider->boot($typeMapper);
39
}
0 commit comments