Symfony\Bundle\FrameworkBundle\Tests\Console\ApplicationTest::createBundleMock PHP Method

createBundleMock() private method

private createBundleMock ( array $commands )
$commands array
    private function createBundleMock(array $commands)
    {
        $bundle = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Bundle\\Bundle')->getMock();
        $bundle->expects($this->once())->method('registerCommands')->will($this->returnCallback(function (Application $application) use($commands) {
            $application->addCommands($commands);
        }));
        return $bundle;
    }