Skip to content

Commit 9ffa578

Browse files
committed
Add missing test for advertised feature
1 parent 6a84a0d commit 9ffa578

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/unit/Factories/ServiceListTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,27 @@ public function testInvoke()
5353
static::assertEquals($values, $result);
5454
}
5555

56+
public function testInvokeAssoc()
57+
{
58+
$services = [
59+
'foo' => 'hello',
60+
'bar' => 'world',
61+
];
62+
63+
$map = array_combine([
64+
'alpha',
65+
'beta',
66+
], array_keys($services));
67+
$values = array_values($services);
68+
69+
$container = MockContainer::with($this, $services);
70+
71+
$subject = new ServiceList($map);
72+
$result = $subject($container);
73+
74+
static::assertEquals(array_combine($map, $values), $result);
75+
}
76+
5677
/**
5778
* @since [*next-version*]
5879
*/

0 commit comments

Comments
 (0)