Permalink
Browse files

Updating FixtureTask and FixtureTask test to use TemplateTask

  • Loading branch information...
markstory committed May 13, 2009
1 parent dff90e8 commit a38233e75d10b2884b9e6d8fc0e0f72d0085d19f
Showing with 7 additions and 7 deletions.
  1. +4 −6 cake/console/libs/tasks/fixture.php
  2. +3 −1 cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -42,7 +42,7 @@ class FixtureTask extends Shell {
* @var array
* @access public
*/
- var $tasks = array('DbConfig', 'Model');
+ var $tasks = array('DbConfig', 'Model', 'Template');
/**
* path to fixtures directory
*
@@ -219,11 +219,9 @@ function generateFixtureFile($model, $otherVars) {
}
$filename = Inflector::underscore($model) . '_fixture.php';
- $Generator = new CodeGenerator();
- $Generator->setPaths($this->Dispatch->shellPaths);
- $Generator->set('model', $model);
- $Generator->set($vars);
- $content = $Generator->generate('objects', 'fixture');
+ $this->Template->set('model', $model);
+ $this->Template->set($vars);
+ $content = $this->Template->generate('objects', 'fixture');
$this->out("\nBaking test fixture for $model...");
$this->createFile($path . $filename, $content);
@@ -38,7 +38,7 @@
}
if (!class_exists('FixtureTask')) {
- require CAKE . 'console' . DS . 'libs' . DS . 'bake.php';
+ require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php';
require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php';
}
@@ -80,7 +80,9 @@ function startTest() {
$this->Task =& new MockFixtureTask();
$this->Task->Model =& new MockFixtureModelTask();
$this->Task->Dispatch = new $this->Dispatcher;
+ $this->Task->Template =& new TemplateTask($this->Task->Dispatch);
$this->Task->Dispatch->shellPaths = Configure::read('shellPaths');
+ $this->Task->Template->initialize();
}
/**
* tearDown method

0 comments on commit a38233e

Please sign in to comment.