8000 Remove usage of setParameter for command class · symfony/symfony@cd33405 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd33405

Browse files
SenseExceptionfabpot
authored andcommitted
Remove usage of setParameter for command class
1 parent 4c91f5e commit cd33405

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConsoleCommandPassTest.php

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -97,35 +97,12 @@ public function testProcessServicesWithSameCommand()
9797
{
9898
$container = new ContainerBuilder();
9999
$container->addCompilerPass(new AddConsoleCommandPass());
100-
$container->setParameter('my-command.class', 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\MyCommand');
101-
102-
$definition1 = new Definition('%my-command.class%');
103-
$definition1->addTag('console.command');
104-
105-
$definition2 = new Definition('%my-command.class%');
106-
$definition2->addTag('console.command');
107-
108-
$container->setDefinition('my-command1', $definition1);
109-
$container->setDefinition('my-command2', $definition2);
110-
111-
$container->compile();
112-
113-
$alias1 = 'console.command.symfony_bundle_frameworkbundle_tests_dependencyinjection_compiler_mycommand';
114-
$alias2 = $alias1 . '_my-command2';
115-
$this->assertTrue($container->hasAlias($alias1));
116-
$this->assertTrue($container->hasAlias($alias2));
117-
}
118-
119-
public function testProcessServicesWithSameCommand()
120-
{
121-
$container = new ContainerBuilder();
122-
$container->addCompilerPass(new AddConsoleCommandPass());
123-
$container->setParameter('my-command.class', 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\MyCommand');
100+
$className = 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\MyCommand';
124101

125-
$definition1 = new Definition('%my-command.class%');
102+
$definition1 = new Definition($className);
126103
$definition1->addTag('console.command');
127104

128-
$definition2 = new Definition('%my-command.class%');
105+
$definition2 = new Definition($className);
129106
$definition2->addTag('console.command');
130107

131108
$container->setDefinition('my-command1', $definition1);
< 3760 /code>

0 commit comments

Comments
 (0)
0