29
29
30
30
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
31
31
{
32
- /**
33
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions
34
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions
35
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition
36
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition
37
- */
38
32
public function testDefinitions ()
39
33
{
40
34
$ builder = new ContainerBuilder ();
@@ -62,9 +56,6 @@ public function testDefinitions()
62
56
}
63
57
}
64
58
65
- /**
66
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::register
67
- */
68
59
public function testRegister ()
69
60
{
70
61
$ builder = new ContainerBuilder ();
@@ -73,9 +64,6 @@ public function testRegister()
73
64
$ this ->assertInstanceOf ('Symfony\Component\DependencyInjection\Definition ' , $ builder ->getDefinition ('foo ' ), '->register() returns the newly created Definition instance ' );
74
65
}
75
66
76
- /**
77
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::has
78
- */
79
67
public function testHas ()
80
68
{
81
69
$ builder = new ContainerBuilder ();
@@ -86,9 +74,6 @@ public function testHas()
86
74
$ this ->assertTrue ($ builder ->has ('bar ' ), '->has() returns true if a service exists ' );
87
75
}
88
76
89
- /**
90
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
91
- */
92
77
public function testGet ()
93
78
{
94
79
$ builder = new ContainerBuilder ();
@@ -121,7 +106,6 @@ public function testGet()
121
106
}
122
107
123
108
/**
124
- * @covers \Symfony\Component\DependencyInjection\ContainerBuilder::get
125
109
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
126
110
* @expectedExceptionMessage You have requested a synthetic service ("foo"). The DIC does not know how to construct this service.
127
111
*/
@@ -140,9 +124,6 @@ public function testGetUnsetLoadingServiceWhenCreateServiceThrowsAnException()
140
124
$ builder ->get ('foo ' );
141
125
}
142
126
143
- /**
144
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
145
- */
146
127
public function testGetReturnsNullOnInactiveScope ()
147
128
{
148
129
$ builder = new ContainerBuilder ();
@@ -151,19 +132,13 @@ public function testGetReturnsNullOnInactiveScope()
151
132
$ this ->assertNull ($ builder ->get ('foo ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ));
152
133
}
153
134
154
- /**
155
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
156
- */
157
135
public function testGetReturnsNullOnInactiveScopeWhenServiceIsCreatedByAMethod ()
158
136
{
159
137
$ builder = new ProjectContainer ();
160
138
161
139
$ this ->assertNull ($ builder ->get ('foobaz ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ));
162
140
}
163
141
164
- /**
165
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
166
- */
167
142
public function testGetServiceIds ()
168
143
{
169
144
$ builder = new ContainerBuilder ();
@@ -173,11 +148,6 @@ public function testGetServiceIds()
173
148
$ this ->assertEquals (array ('foo ' , 'bar ' , 'service_container ' ), $ builder ->getServiceIds (), '->getServiceIds() returns all defined service ids ' );
174
149
}
175
150
176
- /**
177
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias
178
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias
179
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias
180
- */
181
151
public function testAliases ()
182
152
{
183
153
$ builder = new ContainerBuilder ();
@@ -204,9 +174,6 @@ public function testAliases()
204
174
}
205
175
}
206
176
207
- /**
208
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases
209
- */
210
177
public function testGetAliases ()
211
178
{
212
179
$ builder = new ContainerBuilder ();
@@ -229,9 +196,6 @@ public function testGetAliases()
229
196
$ this ->assertCount (0 , $ builder ->getAliases (), '->getAliases() does not return aliased services that have been overridden ' );
230
197
}
231
198
232
- /**
233
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases
234
- */
235
199
public function testSetAliases ()
236
200
{
237
201
$ builder = new ContainerBuilder ();
@@ -242,9 +206,6 @@ public function testSetAliases()
242
206
$ this ->assertTrue (isset ($ aliases ['foobar ' ]));
243
207
}
244
208
245
- /**
246
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases
247
- */
248
209
public function testAddAliases ()
249
210
{
250
211
$ builder = new ContainerBuilder ();
@@ -256,10 +217,6 @@ public function testAddAliases()
256
217
$ this ->assertTrue (isset ($ aliases ['foobar ' ]));
257
218
}
258
219
259
- /**
260
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass
261
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig
262
- */
263
220
public function testAddGetCompilerPass ()
264
221
{
265
222
$ builder = new ContainerBuilder ();
@@ -270,9 +227,6 @@ public function testAddGetCompilerPass()
270
227
$ this ->assertCount (count ($ builder ->getCompiler ()->getPassConfig ()->getPasses ()) - 1 , $ builderCompilerPasses );
271
228
}
272
229
273
- /**
274
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
275
- */
276
230
public function testCreateService ()
277
231
{
278
232
$ builder = new ContainerBuilder ();
@@ -283,9 +237,6 @@ public function testCreateService()
283
237
$ this ->assertInstanceOf ('\FooClass ' , $ builder ->get ('foo2 ' ), '->createService() replaces parameters in the file provided by the service definition ' );
284
238
}
285
239
286
- /**
287
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
288
- */
289
240
public function testCreateProxyWithRealServiceInstantiator ()
290
241
{
291
242
$ builder = new ContainerBuilder ();
@@ -299,9 +250,6 @@ public function testCreateProxyWithRealServiceInstantiator()
299
250
$ this ->assertSame ('FooClass ' , get_class ($ foo1 ));
300
251
}
301
252
302
- /**
303
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
304
- */
305
253
public function testCreateServiceClass ()
306
254
{
307
255
$ builder = new ContainerBuilder ();
@@ -310,9 +258,6 @@ public function testCreateServiceClass()
310
258
$ this ->assertInstanceOf ('\stdClass ' , $ builder ->get ('foo1 ' ), '->createService() replaces parameters in the class provided by the service definition ' );
311
259
}
312
260
313
- /**
314
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
315
- */
316
261
public function testCreateServiceArguments ()
317
262
{
318
263
$ builder = new ContainerBuilder ();
@@ -322,9 +267,6 @@ public function testCreateServiceArguments()
322
267
$ this ->assertEquals (array ('foo ' => 'bar ' , 'bar ' => 'foo ' , $ builder ->get ('bar ' ), '%unescape_it% ' ), $ builder ->get ('foo1 ' )->arguments , '->createService() replaces parameters and service references in the arguments provided by the service definition ' );
323
268
}
324
269
325
- /**
326
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
327
- */
328
270
public function testCreateServiceFactoryMethod ()
329
271
{
330
272
$ builder = new ContainerBuilder ();
@@ -341,9 +283,6 @@ public function testCreateServiceFactoryMethod()
341
283
$ this ->assertEquals (array ('foo ' => 'bar ' , 'bar ' => 'foo ' , $ builder ->get ('bar ' )), $ builder ->get ('foo1 ' )->arguments , '->createService() passes the arguments to the factory method ' );
342
284
}
343
285
344
- /**
345
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
346
- */
347
286
public function testCreateServiceFactoryService ()
348
287
{
349
288
$ builder = new ContainerBuilder ();
@@ -357,9 +296,6 @@ public function testCreateServiceFactoryService()
357
296
$ this ->assertTrue ($ builder ->get ('foo ' )->called , '->createService() calls the factory method to create the service instance ' );
358
297
}
359
298
360
- /**
361
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
362
- */
363
299
public function testCreateServiceMethodCalls ()
364
300
{
365
301
$ builder = new ContainerBuilder ();
@@ -369,9 +305,6 @@ public function testCreateServiceMethodCalls()
369
305
$ this ->assertEquals (array ('bar ' , $ builder ->get ('bar ' )), $ builder ->get ('foo1 ' )->bar , '->createService() replaces the values in the method calls arguments ' );
370
306
}
371
307
372
- /**
373
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
374
- */
375
308
public function testCreateServiceConfigurator ()
376
309
{
377
310
$ builder = new ContainerBuilder ();
@@ -396,7 +329,6 @@ public function testCreateServiceConfigurator()
396
329
}
397
330
398
331
/**
399
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
400
332
* @expectedException \RuntimeException
401
333
*/
402
334
public function testCreateSyntheticService ()
@@ -406,9 +338,6 @@ public function testCreateSyntheticService()
406
338
$ builder ->get ('foo ' );
407
339
}
408
340
409
- /**
410
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices
411
- */
412
341
public function testResolveServices ()
413
342
{
414
343
$ builder = new ContainerBuilder ();
@@ -417,9 +346,6 @@ public function testResolveServices()
417
346
$ this ->assertEquals (array ('foo ' => array ('foo ' , $ builder ->get ('foo ' ))), $ builder ->resolveServices (array ('foo ' => array ('foo ' , new Reference ('foo ' )))), '->resolveServices() resolves service references to service instances in nested arrays ' );
418
347
}
419
348
420
- /**
421
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
422
- */
423
349
public function testMerge ()
424
350
{
425
351
$ container = new ContainerBuilder (new ParameterBag (array ('bar ' => 'foo ' )));
@@ -467,7 +393,6 @@ public function testMerge()
467
393
}
468
394
469
395
/**
470
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
471
396
* @expectedException \LogicException
472
397
*/
473
398
public function testMergeLogicException ()
@@ -478,9 +403,6 @@ public function testMergeLogicException()
478
403
$ container ->merge (new ContainerBuilder ());
479
404
}
480
405
481
- /**
482
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds
483
- */
484
406
public function testfindTaggedServiceIds ()
485
407
{
486
408
$ builder = new ContainerBuilder ();
@@ -499,9 +421,6 @@ public function testfindTaggedServiceIds()
499
421
$ this ->assertEquals (array (), $ builder ->findTaggedServiceIds ('foobar ' ), '->findTaggedServiceIds() returns an empty array if there is annotated services ' );
500
422
}
501
423
502
- /**
503
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition
504
- */
505
424
public function testFindDefinition ()
506
425
{
507
426
$ container = new ContainerBuilder ();
@@ -511,9 +430,6 @@ public function testFindDefinition()
511
430
$ this ->assertEquals ($ definition , $ container ->findDefinition ('foobar ' ), '->findDefinition() returns a Definition ' );
512
431
}
513
432
514
- /**
515
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addObjectResource
516
- */
517
433
public function testAddObjectResource ()
518
434
{
519
435
$ container = new ContainerBuilder ();
@@ -537,9 +453,6 @@ public function testAddObjectResource()
537
453
$ this ->assertSame (realpath (__DIR__ .'/Fixtures/includes/classes.php ' ), realpath ($ resource ->getResource ()));
538
454
}
539
455
540
- /**
541
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource
542
- */
543
456
public function testAddClassResource ()
544
457
{
545
458
$ container = new ContainerBuilder ();
@@ -563,9 +476,6 @@ public function testAddClassResource()
563
476
$ this ->assertSame (realpath (__DIR__ .'/Fixtures/includes/classes.php ' ), realpath ($ resource ->getResource ()));
564
477
}
565
478
566
- /**
567
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::compile
568
- */
569
479
public function testCompilesClassDefinitionsOfLazyServices ()
570
480
{
571
481
$ container = new ContainerBuilder ();
@@ -588,10 +498,6 @@ function (ResourceInterface $resource) use ($classesPath) {
588
498
$ this ->assertNotEmpty ($ matchingResources );
589
499
}
590
500
591
- /**
592
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources
593
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource
594
- */
595
501
public function testResources ()
596
502
{
597
503
$ container = new ContainerBuilder ();
@@ -608,10 +514,6 @@ public function testResources()
608
514
$ this ->assertEquals (array (), $ container ->getResources ());
609
515
}
610
516
611
- /**
612
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension
613
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension
614
- */
615
517
public function testExtension ()
616
518
{
617
519
$ container = new ContainerBuilder ();
@@ -757,10 +659,6 @@ public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer()
757
659
$ container ->setDefinition ('a ' , new Definition ());
758
660
}
759
661
760
- /**
761
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig
762
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig
763
- */
764
662
public function testExtensionConfig ()
765
663
{
766
664
$ container = new ContainerBuilder ();
0 commit comments