8000 Adding details about the Symfony framework as comments · symfony/symfony-docs@f979387 · GitHub
[go: up one dir, main page]

Skip to content

Commit f979387

Browse files
committed
Adding details about the Symfony framework as comments
1 parent af77f5e commit f979387

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

console.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,21 @@ console::
217217

218218
use AppBundle\Command\CreateUserCommand;
219219
use Symfony\Component\Console\Application;
220+
// use this if you're in the Symfony Framework
221+
//use Symfony\Bundle\FrameworkBundle\Console\Application;
220222
use Symfony\Component\Console\Tester\CommandTester;
221223

222224
class CreateUserCommandTest extends \PHPUnit_Framework_TestCase
223225
{
224226
public function testExecute()
225227
{
226228
$application = new Application();
229+
230+
// if you're in the Symfony framework, do this instead
231+
// extend the KernelTestCase class
232+
// self::bootKernel();
233+
// $application = new Application(self::$kernel);
234+
227235
$application->add(new CreateUserCommand());
228236

229237
$command = $application->find('app:create-user');
@@ -251,13 +259,6 @@ console::
251259
You can also test a whole console application by using
252260
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`.
253261

254-
.. note::
255-
256-
When using the Console component in a standalone project, use
257-
:class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`
258-
instead of
259-
:class:`Symfony\\Bundle\\FrameworkBundle\\Console\\Application <Symfony\\Bundle\\FrameworkBundle\\Console\\Application>`
260-
261262
To be able to use the fully set up service container for your console tests
262263
you can extend your test from
263264
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase`::

0 commit comments

Comments
 (0)
0