diff -r 000000000000 -r 7f95f8617b0b vendor/symfony/src/Symfony/Bundle/DoctrineBundle/Tests/Command/InfoDoctrineCommandTest.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/symfony/src/Symfony/Bundle/DoctrineBundle/Tests/Command/InfoDoctrineCommandTest.php Sat Sep 24 15:40:41 2011 +0200 @@ -0,0 +1,45 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Symfony\Bundle\DoctrineBundle\Tests\Command; + +use Symfony\Bundle\DoctrineBundle\Tests\TestCase; +use Symfony\Bundle\DoctrineBundle\Command\InfoDoctrineCommand; +use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Input\StringInput; + +require_once __DIR__.'/../DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php'; + +class InfoDoctrineCommandTest extends TestCase +{ + public function testAnnotationsBundle() + { + $input = new StringInput('doctrine:mapping:info'); + $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); + $output->expects($this->at(0)) + ->method('writeln') + ->with($this->equalTo('Found 1 entities mapped in entity manager default:')); + $output->expects($this->at(1)) + ->method('writeln') + ->with($this->equalTo('[OK] Fixtures\Bundles\YamlBundle\Entity\Test')); + + $testContainer = $this->createYamlBundleTestContainer(); + $kernel = $this->getMock('Symfony\Component\HttpKernel\Kernel', array(), array(), '', false); + $kernel->expects($this->once()) + ->method('getContainer') + ->will($this->returnValue($testContainer)); + $application = new Application($kernel); + + $cmd = new InfoDoctrineCommand(); + $cmd->setApplication($application); + $cmd->run($input, $output); + } +}