1
0
mirror of synced 2025-03-09 22:36:14 +03:00

56 lines
1.6 KiB
PHP
Raw Normal View History

2014-08-23 11:44:54 +02:00
<?php
namespace Doctrine\Tests\ORM\Tools\Console\Command;
use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\MappingException;
2014-08-23 11:44:54 +02:00
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
use Doctrine\Tests\Models\Cache\AttractionInfo;
use Doctrine\Tests\Models\Cache\City;
2014-08-23 11:44:54 +02:00
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Application;
use Doctrine\Tests\OrmFunctionalTestCase;
use Doctrine\ORM\Tools\Console\Command\InfoCommand;
class InfoCommandTest extends OrmFunctionalTestCase
{
/**
* @var \Symfony\Component\Console\Application
*/
private $application;
/**
2014-08-23 13:33:58 +02:00
* @var \Doctrine\ORM\Tools\Console\Command\InfoCommand
2014-08-23 11:44:54 +02:00
*/
private $command;
/**
* @var \Symfony\Component\Console\Tester\CommandTester
*/
private $tester;
protected function setUp()
{
parent::setUp();
$this->application = new Application();
$this->application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($this->_em)]));
$this->application->add(new InfoCommand());
2014-08-23 11:44:54 +02:00
$this->command = $this->application->find('orm:info');
$this->tester = new CommandTester($this->command);
2014-08-23 11:44:54 +02:00
}
public function testListAllClasses()
{
$this->tester->execute(['command' => $this->command->getName()]);
2014-08-23 11:44:54 +02:00
self::assertContains(AttractionInfo::class, $this->tester->getDisplay());
self::assertContains(City::class, $this->tester->getDisplay());
2014-08-23 11:44:54 +02:00
}
}