Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 5912eee

Browse files
committed
Fix failing tests
- Fixes two tests for options usage to use `build()` when providing options.
1 parent 3e9a5fb commit 5912eee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/ServiceManagerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public function testCanEnableSharedForSingleService()
8888
$this->assertSame($object1, $object2);
8989
}
9090

91-
public function testCanCreateObjectWithInvokableFactory()
91+
public function testCanBuildObjectWithInvokableFactory()
9292
{
9393
$serviceManager = new ServiceManager([
9494
'factories' => [
9595
InvokableObject::class => InvokableFactory::class
9696
]
9797
]);
9898

99-
$object = $serviceManager->get(InvokableObject::class, ['foo' => 'bar']);
99+
$object = $serviceManager->build(InvokableObject::class, ['foo' => 'bar']);
100100

101101
$this->assertInstanceOf(InvokableObject::class, $object);
102102
$this->assertEquals(['foo' => 'bar'], $object->options);
@@ -174,7 +174,7 @@ public function testCanCheckServiceExistenceWithCheckingAbstractFactories()
174174
$this->assertTrue($serviceManager->has(DateTime::class, true));
175175
}
176176

177-
public function testNeverShareIfOptionsArePassed()
177+
public function testBuildNeverSharesInstances()
178178
{
179179
$serviceManager = new ServiceManager([
180180
'factories' => [
@@ -185,8 +185,8 @@ public function testNeverShareIfOptionsArePassed()
185185
]
186186
]);
187187

188-
$object1 = $serviceManager->get(stdClass::class);
189-
$object2 = $serviceManager->get(stdClass::class, ['foo' => 'bar']);
188+
$object1 = $serviceManager->build(stdClass::class);
189+
$object2 = $serviceManager->build(stdClass::class, ['foo' => 'bar']);
190190

191191
$this->assertNotSame($object1, $object2);
192192
}

0 commit comments

Comments
 (0)