Merge branch '2.0'
* 2.0: Fixes incorrect class used in src/Symfony/Bundle/FrameworkBundle/Console/Application.php [FrameworkBundle] added test for fix broken command registration corrected phpdoc
This commit is contained in:
commit
c5346610f3
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,7 +560,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||||||
*
|
*
|
||||||
* @param string $id The service identifier
|
* @param string $id The service identifier
|
||||||
*
|
*
|
||||||
* @return Definition A Definition instance
|
* @return Alias An Alias instance
|
||||||
*
|
*
|
||||||
* @throws InvalidArgumentException if the alias does not exist
|
* @throws InvalidArgumentException if the alias does not exist
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user