merged branch SamsonIT/fix_broken_command_registration (PR #5169)
Commits -------55a0b34
Fixes incorrect class used in src/Symfony/Bundle/FrameworkBundle/Console/Application.php79c547f
[FrameworkBundle] added test for fix broken command registration Discussion ---------- [FrameworkBundle] fix broken command registration fixed #5168, #5166 --------------------------------------------------------------------------- by travisbot at 2012-08-03T11:35:29Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2027699) (merged 39e964b8 intofee3f4e1
). --------------------------------------------------------------------------- by travisbot at 2012-08-03T11:45:14Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2027761) (merged55a0b347
intofee3f4e1
). --------------------------------------------------------------------------- by xeross at 2012-08-03T11:45:45Z Duplicate of #5166 --------------------------------------------------------------------------- by Burgov at 2012-08-03T11:47:54Z @xeross that PR was opened on master instead of 2.0 --------------------------------------------------------------------------- by xeross at 2012-08-03T11:48:49Z @Burgov Ah sorry, I got confused and thought this was another dupe
This commit is contained in:
commit
89dce2df51
@ -17,7 +17,7 @@ use Symfony\Component\Console\Input\InputOption;
|
|||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\HttpKernel\KernelInterface;
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
use Symfony\Component\HttpKernel\Kernel;
|
use Symfony\Component\HttpKernel\Kernel;
|
||||||
use Symfony\Component\HttpKernel\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application.
|
* Application.
|
||||||
|
@ -22,14 +22,32 @@ class ApplicationTest extends TestCase
|
|||||||
{
|
{
|
||||||
$bundle = $this->getMock("Symfony\Component\HttpKernel\Bundle\BundleInterface");
|
$bundle = $this->getMock("Symfony\Component\HttpKernel\Bundle\BundleInterface");
|
||||||
|
|
||||||
$kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface");
|
$kernel = $this->getKernel(array($bundle));
|
||||||
$kernel
|
|
||||||
->expects($this->any())
|
|
||||||
->method('getBundles')
|
|
||||||
->will($this->returnValue(array($bundle)))
|
|
||||||
;
|
|
||||||
|
|
||||||
$application = new Application($kernel);
|
$application = new Application($kernel);
|
||||||
$application->doRun(new ArrayInput(array('list')), new NullOutput());
|
$application->doRun(new ArrayInput(array('list')), new NullOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBundleCommandsAreRegistered()
|
||||||
|
{
|
||||||
|
$bundle = $this->getMock("Symfony\Component\HttpKernel\Bundle\Bundle");
|
||||||
|
$bundle->expects($this->once())->method('registerCommands');
|
||||||
|
|
||||||
|
$kernel = $this->getKernel(array($bundle));
|
||||||
|
|
||||||
|
$application = new Application($kernel);
|
||||||
|
$application->doRun(new ArrayInput(array('list')), new NullOutput());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getKernel(array $bundles)
|
||||||
|
{
|
||||||
|
$kernel = $this->getMock("Symfony\Component\HttpKernel\KernelInterface");
|
||||||
|
$kernel
|
||||||
|
->expects($this->any())
|
||||||
|
->method('getBundles')
|
||||||
|
->will($this->returnValue($bundles))
|
||||||
|
;
|
||||||
|
|
||||||
|
return $kernel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user