30
30
31
31
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
32
32
{
33
- /**
34
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinitions
35
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinitions
36
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setDefinition
37
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getDefinition
38
- */
39
33
public function testDefinitions ()
40
34
{
41
35
$ builder = new ContainerBuilder ();
@@ -63,9 +57,6 @@ public function testDefinitions()
63
57
}
64
58
}
65
59
66
- /**
67
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::register
68
- */
69
60
public function testRegister ()
70
61
{
71
62
$ builder = new ContainerBuilder ();
@@ -74,9 +65,6 @@ public function testRegister()
74
65
$ this ->assertInstanceOf ('Symfony\Component\DependencyInjection\Definition ' , $ builder ->getDefinition ('foo ' ), '->register() returns the newly created Definition instance ' );
75
66
}
76
67
77
- /**
78
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::has
79
- */
80
68
public function testHas ()
81
69
{
82
70
$ builder = new ContainerBuilder ();
@@ -87,9 +75,6 @@ public function testHas()
87
75
$ this ->assertTrue ($ builder ->has ('bar ' ), '->has() returns true if a service exists ' );
88
76
}
89
77
90
- /**
91
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
92
- */
93
78
public function testGet ()
94
79
{
95
80
$ builder = new ContainerBuilder ();
@@ -122,7 +107,6 @@ public function testGet()
122
107
}
123
108
124
109
/**
125
- * @covers \Symfony\Component\DependencyInjection\ContainerBuilder::get
126
110
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
127
111
* @expectedExceptionMessage You have requested a synthetic service ("foo"). The DIC does not know how to construct this service.
128
112
*/
@@ -141,9 +125,6 @@ public function testGetUnsetLoadingServiceWhenCreateServiceThrowsAnException()
141
125
$ builder ->get ('foo ' );
142
126
}
143
127
144
- /**
145
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
146
- */
147
128
public function testGetReturnsNullOnInactiveScope ()
148
129
{
149
130
$ builder = new ContainerBuilder ();
@@ -152,19 +133,13 @@ public function testGetReturnsNullOnInactiveScope()
152
133
$ this ->assertNull ($ builder ->get ('foo ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ));
153
134
}
154
135
155
- /**
156
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
157
- */
158
136
public function testGetReturnsNullOnInactiveScopeWhenServiceIsCreatedByAMethod ()
159
137
{
160
138
$ builder = new ProjectContainer ();
161
139
162
140
$ this ->assertNull ($ builder ->get ('foobaz ' , ContainerInterface::NULL_ON_INVALID_REFERENCE ));
163
141
}
164
142
165
- /**
166
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
167
- */
168
143
public function testGetServiceIds ()
169
144
{
170
145
$ builder = new ContainerBuilder ();
@@ -174,11 +149,6 @@ public function testGetServiceIds()
174
149
$ this ->assertEquals (array ('foo ' , 'bar ' , 'service_container ' ), $ builder ->getServiceIds (), '->getServiceIds() returns all defined service ids ' );
175
150
}
176
151
177
- /**
178
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAlias
179
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::hasAlias
180
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAlias
181
- */
182
152
public function testAliases ()
183
153
{
184
154
$ builder = new ContainerBuilder ();
@@ -205,9 +175,6 @@ public function testAliases()
205
175
}
206
176
}
207
177
208
- /**
209
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getAliases
210
- */
211
178
public function testGetAliases ()
212
179
{
213
180
$ builder = new ContainerBuilder ();
@@ -230,9 +197,6 @@ public function testGetAliases()
230
197
$ this ->assertCount (0 , $ builder ->getAliases (), '->getAliases() does not return aliased services that have been overridden ' );
231
198
}
232
199
233
- /**
234
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::setAliases
235
- */
236
200
public function testSetAliases ()
237
201
{
238
202
$ builder = new ContainerBuilder ();
@@ -243,9 +207,6 @@ public function testSetAliases()
243
207
$ this ->assertTrue (isset ($ aliases ['foobar ' ]));
244
208
}
245
209
246
- /**
247
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addAliases
248
- */
249
210
public function testAddAliases ()
250
211
{
251
212
$ builder = new ContainerBuilder ();
@@ -257,10 +218,6 @@ public function testAddAliases()
257
218
$ this ->assertTrue (isset ($ aliases ['foobar ' ]));
258
219
}
259
220
260
- /**
261
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass
262
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig
263
- */
264
221
public function testAddGetCompilerPass ()
265
222
{
266
223
$ builder = new ContainerBuilder ();
@@ -271,9 +228,6 @@ public function testAddGetCompilerPass()
271
228
$ this ->assertCount (count ($ builder ->getCompiler ()->getPassConfig ()->getPasses ()) - 1 , $ builderCompilerPasses );
272
229
}
273
230
274
- /**
275
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
276
- */
277
231
public function testCreateService ()
278
232
{
279
233
$ builder = new ContainerBuilder ();
@@ -284,9 +238,6 @@ public function testCreateService()
284
238
$ this ->assertInstanceOf ('\Bar\FooClass ' , $ builder ->get ('foo2 ' ), '->createService() replaces parameters in the file provided by the service definition ' );
285
239
}
286
240
287
- /**
288
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
289
- */
290
241
public function testCreateProxyWithRealServiceInstantiator ()
291
242
{
292
243
$ builder = new ContainerBuilder ();
@@ -300,9 +251,6 @@ public function testCreateProxyWithRealServiceInstantiator()
300
251
$ this ->assertSame ('Bar\FooClass ' , get_class ($ foo1 ));
301
252
}
302
253
303
- /**
304
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
305
- */
306
254
public function testCreateServiceClass ()
307
255
{
308
256
$ builder = new ContainerBuilder ();
@@ -311,9 +259,6 @@ public function testCreateServiceClass()
311
259
$ this ->assertInstanceOf ('\stdClass ' , $ builder ->get ('foo1 ' ), '->createService() replaces parameters in the class provided by the service definition ' );
312
260
}
313
261
314
- /**
315
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
316
- */
317
262
public function testCreateServiceArguments ()
318
263
{
319
264
$ builder = new ContainerBuilder ();
@@ -323,9 +268,6 @@ public function testCreateServiceArguments()
323
268
$ 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 ' );
324
269
}
325
270
326
- /**
327
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
328
- */
329
271
public function testCreateServiceFactory ()
330
272
{
331
273
$ builder = new ContainerBuilder ();
@@ -356,9 +298,6 @@ public function testLegacyCreateServiceFactory()
356
298
$ this ->assertEquals (array ('foo ' => 'bar ' , 'bar ' => 'foo ' , $ builder ->get ('bar ' )), $ builder ->get ('foo1 ' )->arguments , '->createService() passes the arguments to the factory method ' );
357
299
}
358
300
359
- /**
360
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
361
- */
362
301
public function testLegacyCreateServiceFactoryService ()
363
302
{
364
303
$ builder = new ContainerBuilder ();
@@ -372,9 +311,6 @@ public function testLegacyCreateServiceFactoryService()
372
311
$ this ->assertTrue ($ builder ->get ('foo ' )->called , '->createService() calls the factory method to create the service instance ' );
373
312
}
374
313
375
- /**
376
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
377
- */
378
314
public function testCreateServiceMethodCalls ()
379
315
{
380
316
$ builder = new ContainerBuilder ();
@@ -384,9 +320,6 @@ public function testCreateServiceMethodCalls()
384
320
$ this ->assertEquals (array ('bar ' , $ builder ->get ('bar ' )), $ builder ->get ('foo1 ' )->bar , '->createService() replaces the values in the method calls arguments ' );
385
321
}
386
322
387
- /**
388
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
389
- */
390
323
public function testCreateServiceConfigurator ()
391
324
{
392
325
$ builder = new ContainerBuilder ();
@@ -414,7 +347,6 @@ public function testCreateServiceConfigurator()
414
347
}
415
348
416
349
/**
417
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
418
350
* @expectedException \RuntimeException
419
351
*/
420
352
public function testCreateSyntheticService ()
@@ -433,9 +365,6 @@ public function testCreateServiceWithExpression()
433
365
$ this ->assertEquals ('foobar ' , $ builder ->get ('foo ' )->arguments ['foo ' ]);
434
366
}
435
367
436
- /**
437
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices
438
- */
439
368
public function testResolveServices ()
440
369
{
441
370
$ builder = new ContainerBuilder ();
@@ -445,9 +374,6 @@ public function testResolveServices()
445
374
$ this ->assertEquals ($ builder ->get ('foo ' ), $ builder ->resolveServices (new Expression ('service("foo") ' )), '->resolveServices() resolves expressions ' );
446
375
}
447
376
448
- /**
449
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
450
- */
451
377
public function testMerge ()
452
378
{
453
379
$ container = new ContainerBuilder (new ParameterBag (array ('bar ' => 'foo ' )));
@@ -493,7 +419,6 @@ public function testMerge()
493
419
}
494
420
495
421
/**
496
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::merge
497
422
* @expectedException \LogicException
498
423
*/
499
424
public function testMergeLogicException ()
@@ -504,9 +429,6 @@ public function testMergeLogicException()
504
429
$ container ->merge (new ContainerBuilder ());
505
430
}
506
431
507
- /**
508
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findTaggedServiceIds
509
- */
510
432
public function testfindTaggedServiceIds ()
511
433
{
512
434
$ builder = new ContainerBuilder ();
@@ -525,9 +447,6 @@ public function testfindTaggedServiceIds()
525
447
$ this ->assertEquals (array (), $ builder ->findTaggedServiceIds ('foobar ' ), '->findTaggedServiceIds() returns an empty array if there is annotated services ' );
526
448
}
527
449
528
- /**
529
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::findDefinition
530
- */
531
450
public function testFindDefinition ()
532
451
{
533
452
$ container = new ContainerBuilder ();
@@ -537,9 +456,6 @@ public function testFindDefinition()
537
456
$ this ->assertEquals ($ definition , $ container ->findDefinition ('foobar ' ), '->findDefinition() returns a Definition ' );
538
457
}
539
458
540
- /**
541
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addObjectResource
542
- */
543
459
public function testAddObjectResource ()
544
460
{
545
461
$ container = new ContainerBuilder ();
@@ -563,9 +479,6 @@ public function testAddObjectResource()
563
479
$ this ->assertSame (realpath (__DIR__ .'/Fixtures/includes/classes.php ' ), realpath ($ resource ->getResource ()));
564
480
}
565
481
566
- /**
567
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addClassResource
568
- */
569
482
public function testAddClassResource ()
570
483
{
571
484
$ container = new ContainerBuilder ();
@@ -589,9 +502,6 @@ public function testAddClassResource()
589
502
$ this ->assertSame (realpath (__DIR__ .'/Fixtures/includes/classes.php ' ), realpath ($ resource ->getResource ()));
590
503
}
591
504
592
- /**
593
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::compile
594
- */
595
505
public function testCompilesClassDefinitionsOfLazyServices ()
596
506
{
597
507
$ container = new ContainerBuilder ();
@@ -614,10 +524,6 @@ function (ResourceInterface $resource) use ($classesPath) {
614
524
$ this ->assertNotEmpty ($ matchingResources );
615
525
}
616
526
617
- /**
618
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getResources
619
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::addResource
620
- */
621
527
public function testResources ()
622
528
{
623
529
$ container = new ContainerBuilder ();
@@ -634,10 +540,6 @@ public function testResources()
634
540
$ this ->assertEquals (array (), $ container ->getResources ());
635
541
}
636
542
637
- /**
638
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension
639
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension
640
- */
641
543
public function testExtension ()
642
544
{
643
545
$ container = new ContainerBuilder ();
@@ -789,10 +691,6 @@ public function testThrowsExceptionWhenSetDefinitionOnAFrozenContainer()
789
691
$ container ->setDefinition ('a ' , new Definition ());
790
692
}
791
693
792
- /**
793
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtensionConfig
794
- * @covers Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig
795
- */
796
694
public function testExtensionConfig ()
797
695
{
798
696
$ container = new ContainerBuilder ();
0 commit comments