1212namespace Symfony \Bundle \FrameworkBundle \Tests \DependencyInjection \Compiler ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Bundle \FrameworkBundle \Command \CachePoolPruneCommand ;
1516use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \CachePoolPrunerPass ;
1617use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
1718use Symfony \Component \Cache \Adapter \PhpFilesAdapter ;
@@ -24,7 +25,7 @@ class CachePoolPrunerPassTest extends TestCase
2425 public function testCompilerPassReplacesCommandArgument ()
2526 {
2627 $ container = new ContainerBuilder ();
27- $ container ->register (' cache.command.pool_pruner ' )->addArgument (array ());
28+ $ container ->register (CachePoolPruneCommand::class )->addArgument (array ());
2829 $ container ->register ('pool.foo ' , FilesystemAdapter::class)->addTag ('cache.pool ' );
2930 $ container ->register ('pool.bar ' , PhpFilesAdapter::class)->addTag ('cache.pool ' );
3031
@@ -35,7 +36,7 @@ public function testCompilerPassReplacesCommandArgument()
3536 'pool.foo ' => new Reference ('pool.foo ' ),
3637 'pool.bar ' => new Reference ('pool.bar ' ),
3738 );
38- $ argument = $ container ->getDefinition (' cache.command.pool_pruner ' )->getArgument (0 );
39+ $ argument = $ container ->getDefinition (CachePoolPruneCommand::class )->getArgument (0 );
3940
4041 $ this ->assertInstanceOf (IteratorArgument::class, $ argument );
4142 $ this ->assertEquals ($ expected , $ argument ->getValues ());
@@ -51,7 +52,7 @@ public function testCompilePassIsIgnoredIfCommandDoesNotExist()
5152 $ container
5253 ->expects ($ this ->atLeastOnce ())
5354 ->method ('hasDefinition ' )
54- ->with (' cache.command.pool_pruner ' )
55+ ->with (CachePoolPruneCommand::class )
5556 ->will ($ this ->returnValue (false ));
5657
5758 $ container
@@ -73,7 +74,7 @@ public function testCompilePassIsIgnoredIfCommandDoesNotExist()
7374 public function testCompilerPassThrowsOnInvalidDefinitionClass ()
7475 {
7576 $ container = new ContainerBuilder ();
76- $ container ->register (' cache.command.pool_pruner ' )->addArgument (array ());
77+ $ container ->register (CachePoolPruneCommand::class )->addArgument (array ());
7778 $ container ->register ('pool.not-found ' , NotFound::class)->addTag ('cache.pool ' );
7879
7980 $ pass = new CachePoolPrunerPass ();
0 commit comments