
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 0.93 KB | hits: 17 | expires: Never
<?php
require_once(__DIR__ . "/../../../../app/AppKernel.php");
class ModelTestCase extends \PHPUnit_Framework_TestCase
{
protected $_application;
public function setUp()
{
$kernel = new \AppKernel("test", true);
$kernel->boot();
$this->_application = new \Symfony\Bundle\FrameworkBundle\Console\Application($kernel);
$this->_application->setAutoExit(false);
$this->runConsole("doctrine:schema:drop", array("--force" => true));
$this->runConsole("doctrine:schema:create");
$this->runConsole("cache:warmup");
$this->runConsole("doctrine:fixtures:load", array("--fixtures" => __DIR__ . "/../DataFixtures"));
}
protected function runConsole($command, Array $options = array())
{
$options["-e"] = "test";
$options["-q"] = null;
$options = array_merge($options, array('command' => $command));
return $this->_application->run(new \Symfony\Component\Console\Input\ArrayInput($options));
}
}