12
12
namespace Symfony \Bundle \FrameworkBundle \Tests \DependencyInjection \Compiler ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Bundle \FrameworkBundle \Command \CachePoolPruneCommand ;
15
16
use Symfony \Bundle \FrameworkBundle \DependencyInjection \Compiler \CachePoolPrunerPass ;
16
17
use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
17
18
use Symfony \Component \Cache \Adapter \PhpFilesAdapter ;
@@ -24,7 +25,7 @@ class CachePoolPrunerPassTest extends TestCase
24
25
public function testCompilerPassReplacesCommandArgument ()
25
26
{
26
27
$ container = new ContainerBuilder ();
27
- $ container ->register (' cache.command.pool_pruner ' )->addArgument (array ());
28
+ $ container ->register (CachePoolPruneCommand::class )->addArgument (array ());
28
29
$ container ->register ('pool.foo ' , FilesystemAdapter::class)->addTag ('cache.pool ' );
29
30
$ container ->register ('pool.bar ' , PhpFilesAdapter::class)->addTag ('cache.pool ' );
30
31
@@ -35,7 +36,7 @@ public function testCompilerPassReplacesCommandArgument()
35
36
'pool.foo ' => new Reference ('pool.foo ' ),
36
37
'pool.bar ' => new Reference ('pool.bar ' ),
37
38
);
38
- $ argument = $ container ->getDefinition (' cache.command.pool_pruner ' )->getArgument (0 );
39
+ $ argument = $ container ->getDefinition (CachePoolPruneCommand::class )->getArgument (0 );
39
40
40
41
$ this ->assertInstanceOf (IteratorArgument::class, $ argument );
41
42
$ this ->assertEquals ($ expected , $ argument ->getValues ());
@@ -51,7 +52,7 @@ public function testCompilePassIsIgnoredIfCommandDoesNotExist()
51
52
$ container
52
53
->expects ($ this ->atLeastOnce ())
53
54
->method ('hasDefinition ' )
54
- ->with (' cache.command.pool_pruner ' )
55
+ ->with (CachePoolPruneCommand::class )
55
56
->will ($ this ->returnValue (false ));
56
57
57
58
$ container
@@ -73,7 +74,7 @@ public function testCompilePassIsIgnoredIfCommandDoesNotExist()
73
74
public function testCompilerPassThrowsOnInvalidDefinitionClass ()
74
75
{
75
76
$ container = new ContainerBuilder ();
76
- $ container ->register (' cache.command.pool_pruner ' )->addArgument (array ());
77
+ $ container ->register (CachePoolPruneCommand::class )->addArgument (array ());
77
78
$ container ->register ('pool.not-found ' , NotFound::class)->addTag ('cache.pool ' );
78
79
79
80
$ pass = new CachePoolPrunerPass ();
0 commit comments