@@ -156,19 +156,7 @@ public function testCanCreateServiceWithAlias()
156
156
$ this ->assertFalse ($ serviceManager ->has ('baz ' ));
157
157
}
158
158
159
- public function testCanCheckServiceExistenceWithoutCheckingAbstractFactories ()
160
- {
161
- $ serviceManager = $ this ->createContainer ([
162
- 'factories ' => [
163
- stdClass::class => InvokableFactory::class
164
- ]
165
- ]);
166
-
167
- $ this ->assertTrue ($ serviceManager ->has (stdClass::class));
168
- $ this ->assertFalse ($ serviceManager ->has (DateTime::class));
169
- }
170
-
171
- public function testCanCheckServiceExistenceWithCheckingAbstractFactories ()
159
+ public function testCheckingServiceExistenceWithChecksAgainstAbstractFactories ()
172
160
{
173
161
$ serviceManager = $ this ->createContainer ([
174
162
'factories ' => [
@@ -179,8 +167,8 @@ public function testCanCheckServiceExistenceWithCheckingAbstractFactories()
179
167
]
180
168
]);
181
169
182
- $ this ->assertTrue ($ serviceManager ->has (stdClass::class, true ));
183
- $ this ->assertTrue ($ serviceManager ->has (DateTime::class, true ));
170
+ $ this ->assertTrue ($ serviceManager ->has (stdClass::class));
171
+ $ this ->assertTrue ($ serviceManager ->has (DateTime::class));
184
172
}
185
173
186
174
public function testBuildNeverSharesInstances ()
@@ -322,23 +310,6 @@ public function testHasReturnsTrueIfFactoryIsConfigured()
322
310
$ this ->assertTrue ($ serviceManager ->has (stdClass::class));
323
311
}
324
312
325
- /**
326
- * @group has
327
- */
328
- public function testHasDoesNotCheckAbstractFactoriesByDefault ()
329
- {
330
- $ serviceManager = $ this ->createContainer ([
331
- 'factories ' => [
332
- stdClass::class => InvokableFactory::class,
333
- ],
334
- 'abstract_factories ' => [
335
- new SimpleAbstractFactory (),
336
- ],
337
- ]);
338
-
339
- $ this ->assertFalse ($ serviceManager ->has (DateTime::class));
340
- }
341
-
342
313
public function abstractFactories ()
343
314
{
344
315
return [
@@ -351,15 +322,15 @@ public function abstractFactories()
351
322
* @group has
352
323
* @dataProvider abstractFactories
353
324
*/
354
- public function testHasCanCheckAbstractFactoriesWhenRequested ($ abstractFactory , $ expected )
325
+ public function testHasChecksAgainstAbstractFactories ($ abstractFactory , $ expected )
355
326
{
356
327
$ serviceManager = $ this ->createContainer ([
357
328
'abstract_factories ' => [
358
329
$ abstractFactory ,
359
330
],
360
331
]);
361
332
362
- $ this ->assertSame ($ expected , $ serviceManager ->has (DateTime::class, true ));
333
+ $ this ->assertSame ($ expected , $ serviceManager ->has (DateTime::class));
363
334
}
364
335
365
336
/**
0 commit comments