public function setup($options, $parameters = array()) { $this->projectDir = dirname(__FILE__).'/../fixtures'; $this->cleanup(); foreach (array('model', 'urlPrefix', 'moduleName', 'singularName', 'pluralName', 'projectDir') as $param) { if (isset($parameters[$param])) { $this->$param = $parameters[$param]; } } chdir($this->projectDir); $task = new sfPropelGenerateModuleForRouteTask(new sfEventDispatcher(), new sfFormatter()); $options[] = 'env=test'; $options[] = '--non-verbose-templates'; $task->run(array('crud', 'articles'), $options); require_once($this->projectDir.'/config/ProjectConfiguration.class.php'); sfContext::createInstance(ProjectConfiguration::getApplicationConfiguration('crud', 'test', true, $this->projectDir)); $options['with-show'] = true; return $options; }
public function setup($options) { $this->projectDir = dirname(__FILE__) . '/../fixtures'; $this->cleanup(); chdir($this->projectDir); $task = new sfPropelGenerateModuleForRouteTask(new sfEventDispatcher(), new sfFormatter()); $options[] = 'env=test'; $options[] = '--non-verbose-templates'; $task->run(array('crud', 'articles'), $options); require_once $this->projectDir . '/config/ProjectConfiguration.class.php'; sfContext::createInstance(ProjectConfiguration::getApplicationConfiguration('crud', 'test', true, $this->projectDir)); $options['with-show'] = true; return $options; }