8000 Avoid "There are no commands defined in the demo namespace" InvalidAr… · GromNaN/symfony-docs@9f80235 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 9f80235

Browse files
committed
Avoid "There are no commands defined in the demo namespace" InvalidArgumentException
1 parent d428a66 commit 9f80235

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cookbook/console.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,15 @@ console::
207207

208208
use Symfony\Component\Console\Tester\CommandTester;
209209
use Symfony\Bundle\FrameworkBundle\Console\Application;
210+
use Acme\DemoBundle\Command\GreetCommand.php;
210211

211212
class ListCommandTest extends \PHPUnit_Framework_TestCase
212213
{
213214
public function testExecute()
214215
{
215216
// mock the Kernel or create one depending on your needs
216217
$application = new Application($kernel);
218+
$application->add(new GreetCommand());
217219

218220
$command = $application->find('demo:greet');
219221
$commandTester = new CommandTester($command);

0 commit comments

Comments
 (0)
0