Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd33405

Browse files
SenseExceptionfabpot
authored andcommitted
Remove usage of setParameter for command class
1 parent4c91f5e commitcd33405

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 =newContainerBuilder();
9999
$container->addCompilerPass(newAddConsoleCommandPass());
100-
$container->setParameter('my-command.class','Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\MyCommand');
101-
102-
$definition1 =newDefinition('%my-command.class%');
103-
$definition1->addTag('console.command');
104-
105-
$definition2 =newDefinition('%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-
publicfunctiontestProcessServicesWithSameCommand()
120-
{
121-
$container =newContainerBuilder();
122-
$container->addCompilerPass(newAddConsoleCommandPass());
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 =newDefinition('%my-command.class%');
102+
$definition1 =newDefinition($className);
126103
$definition1->addTag('console.command');
127104

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

131108
$container->setDefinition('my-command1',$definition1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp