Skip to content

Instantly share code, notes, and snippets.

@spolischook
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save spolischook/2eebb1f9b3d4a1029388 to your computer and use it in GitHub Desktop.

Select an option

Save spolischook/2eebb1f9b3d4a1029388 to your computer and use it in GitHub Desktop.
Load Doctrine fixtures from Controller
<?php
//....
public function indexAction()
{
$application = new Application($this->get('kernel'));
$application->add(new CreateSchemaDoctrineCommand());
$command = $application->find('doctrine:schema:create');
$commandTester = new CommandTester($command);
$commandTester->execute(
array('command' => $command->getName())
);
return array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment