*/ class GeneratorAwareCommandTest extends TestCase { protected $container; protected function setUp() { parent::setUp(); $this->container = $this->getContainer(); $this->container->setParameter('propel.path', __DIR__ . '/../../vendor/propel/propel1'); } public function testGetDatabasesFromSchema() { $command = new GeneratorAwareCommandTestable('testable-command'); $command->setContainer($this->container); $databases = $command->getDatabasesFromSchema(new \SplFileInfo(__DIR__ . '/../Fixtures/schema.xml')); $this->assertTrue(is_array($databases)); foreach ($databases as $database) { $this->assertInstanceOf('\Database', $database); } $bookstore = $databases[0]; $this->assertEquals(1, count($bookstore->getTables())); foreach ($bookstore->getTables() as $table) { $this->assertInstanceOf('\Table', $table); } } } class GeneratorAwareCommandTestable extends GeneratorAwareCommand { protected $container; public function setContainer(ContainerInterface $container = null) { $this->container = $container; } protected function getContainer() { return $this->container; } public function getDatabasesFromSchema(\SplFileInfo $file) { $this->loadPropelGenerator(); return parent::getDatabasesFromSchema($file); } }