@@ -389,26 +389,30 @@ public function testGetName()
389
389
public function getGetNameWithWeirdDirectoryTests ()
390
390
{
391
391
return array (
392
- array ('app ' , 12345 ),
393
- array ('Application ' , '12345Application ' ),
394
- array ('Application12345 ' , 'Application12345 ' ),
395
- array ('Application12345 ' , '12345Application12345 ' ),
392
+ array ('appDevProjectContainer ' , 'dev ' , 'app ' ),
393
+ array ('appFoobarProjectContainer ' , 'foo bar ' , 'app ' ),
394
+ array ('appProjectContainer ' , '..**.. ' , 'app ' ),
395
+ array ('ProjectContainer ' , '..**.. ' , '12345 ' ),
396
+ array ('DevProjectContainer ' , 'dev ' , 12345 ),
397
+ array ('ApplicationDevProjectContainer ' , 'dev ' , '12345Application ' ),
398
+ array ('Application12345DevProjectContainer ' , 'dev ' , 'Application12345 ' ),
399
+ array ('Application12345DevProjectContainer ' , 'dev ' , '12345Application12345 ' ),
396
400
);
397
401
}
398
402
399
403
/** @dataProvider getGetNameWithWeirdDirectoryTests */
400
- public function testGetNameWithWeirdDirectory ($ expected , $ rootDir )
404
+ public function testGetContainerClass ($ expected, $ environment , $ rootDir )
401
405
{
402
- $ kernel = new KernelForTest ('test ' , true );
403
- $ p = new \ReflectionProperty ($ kernel , 'rootDir ' );
404
- $ p ->setAccessible (true );
405
- $ p ->setValue ($ kernel , $ rootDir );
406
+ $ kernel = new KernelForTest ($ environment , false );
406
407
407
408
$ p = new \ReflectionProperty ($ kernel , 'name ' );
408
409
$ p ->setAccessible (true );
409
- $ p ->setValue ($ kernel , null );
410
+ $ p ->setValue ($ kernel , $ rootDir );
411
+
412
+ $ m = new \ReflectionMethod ($ kernel , 'getContainerClass ' );
413
+ $ m ->setAccessible (true );
410
414
411
- $ this ->assertEquals ($ expected , $ kernel -> getName ( ));
415
+ $ this ->assertEquals ($ expected , $ m -> invoke ( $ kernel ));
412
416
}
413
417
414
418
public function testOverrideGetName ()
0 commit comments