This repository was archived by the owner on Jan 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,31 @@ final public function testDelegatorsReceiveCallbackResolvingToReturnValueOfPrevi
280
280
self ::assertSame ($ instance , $ container ->get ($ serviceNameToTest ));
281
281
}
282
282
283
+ /**
284
+ * @dataProvider delegatorService
285
+ */
286
+ final public function testEmptyDelegatorListOriginalServiceShouldBeReturned (
287
+ array $ config ,
288
+ string $ serviceNameToTest ,
289
+ string $ delegatedServiceName
290
+ ) : void {
291
+ $ config += [
292
+ 'delegators ' => [
293
+ $ delegatedServiceName => [],
294
+ ],
295
+ ];
296
+
297
+ $ container = $ this ->createContainer ($ config );
298
+
299
+ self ::assertTrue ($ container ->has ($ serviceNameToTest ));
300
+ $ instance = $ container ->get ($ serviceNameToTest );
301
+ self ::assertInstanceOf (TestAsset \Service::class, $ instance );
302
+ self ::assertEquals ([], $ instance ->injected );
303
+
304
+ // Ensure subsequent retrievals get same instance
305
+ self ::assertSame ($ instance , $ container ->get ($ serviceNameToTest ));
306
+ }
307
+
283
308
final public function testMultipleAliasesForADelegatedInvokableServiceReceiveSameInstance () : void
284
309
{
285
310
$ container = $ this ->createContainer ([
You can’t perform that action at this time.
0 commit comments