application = new Application(); $command = new InfoCommand(); $this->application->setHelperSet(new HelperSet(array( 'em' => new EntityManagerHelper($this->_em) ))); $this->application->add($command); $this->command = $this->application->find('orm:info'); $this->tester = new CommandTester($command); } public function testListAllClasses() { $this->tester->execute(array( 'command' => $this->command->getName(), )); $this->assertContains('Doctrine\Tests\Models\Cache\AttractionInfo', $this->tester->getDisplay()); $this->assertContains('Doctrine\Tests\Models\Cache\City', $this->tester->getDisplay()); } public function testShowSpecificFuzzySingle() { $this->tester->execute(array( 'command' => $this->command->getName(), 'entityName' => 'AttractionInfo', )); $display = $this->tester->getDisplay(); $this->assertContains('Doctrine\Tests\Models\Cache\AttractionInfo', $display); $this->assertContains('Root entity name', $display); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage possible matches: "Doctrine\Tests\Models\Cache\AttractionInfo */ public function testShowSpecificFuzzyAmbiguous() { $this->tester->execute(array( 'command' => $this->command->getName(), 'entityName' => 'Attraction', )); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Could not find any mapped Entity classes matching "AttractionFooBar" */ public function testShowSpecificNotFound() { $this->tester->execute(array( 'command' => $this->command->getName(), 'entityName' => 'AttractionFooBar' )); } /** * This test takes a long time */ public function testShowSpecificSmokeTest() { $entityClassNames = $this->_em->getConfiguration() ->getMetadataDriverImpl() ->getAllClassNames(); foreach ($entityClassNames as $entityClassName) { $this->tester->Execute(array( 'command' => $this->command->getName(), 'entityName' => $entityClassName )); } } }