Last active
August 29, 2015 14:07
-
-
Save gnugat/400729d3f97fd2ed7fc9 to your computer and use it in GitHub Desktop.
Revisions
-
Loïc Chardonnet revised this gist
Oct 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public function __construct() $this->container = $this->kernel->getContainer(); $this->application = new Application($this->kernel); $this->application->setAutoExit(false); } /** -
Loïc Chardonnet revised this gist
Oct 6, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace Gnugat\Ripozi\Test; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; @@ -36,6 +36,7 @@ public function __construct() $this->container = $this->kernel->getContainer(); $this->application = new Application($this->kernel); $this->application->setAutoExit(true); } /** -
Loïc Chardonnet revised this gist
Oct 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public function __construct() */ public function run(array $rawInput) { $input = new ArrayInput($rawInput); $output = new NullOutput(); return $this->application->run($input, $output); -
Loïc Chardonnet revised this gist
Oct 6, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,8 @@ */ class CommandTestApplication { const EXIT_SUCCESS = 0; /** * @var Application */ -
Loïc Chardonnet created this gist
Oct 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,51 @@ <?php namespace Gnugat\Ripozi\Test; use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; /** * Assumes that the application kernel is named AppKernel and has been loaded */ class CommandTestApplication { /** * @var Application */ private $application; /** * @var \Symfony\Component\DependencyInjection\ContainerInterface */ private $container; /** * @var \Symfony\Component\HttpKernel\KernelInterface */ private $kernel; public function __construct() { $this->kernel = new \AppKernel('test', true); $this->kernel->boot(); $this->container = $this->kernel->getContainer(); $this->application = new Application($this->kernel); } /** * @param array $rawInput * * @return int */ public function run(array $rawInput) { $input = new ArrayInput($input); $output = new NullOutput(); return $this->application->run($input, $output); } }