Adding test case and function for generating

fixture lists from controller objects.
This commit is contained in:
mark_story 2009-05-24 01:30:04 -04:00
parent 61191d88cd
commit 1d6ceffb92
2 changed files with 41 additions and 3 deletions

View file

@ -221,7 +221,7 @@ class TestTask extends Shell {
}
/**
* Generate the list of fixtures that will be required to run this test based on
* Generate the list of fixtures that will be required to run this test based on
* loaded models.
*
* @param object The object you want to generate fixtures for.
@ -238,7 +238,7 @@ class TestTask extends Shell {
}
/**
* Process a model recursively and pull out all the
* Process a model recursively and pull out all the
* model names converting them to fixture names.
*
* @return void
@ -260,6 +260,22 @@ class TestTask extends Shell {
}
}
/**
* Process all the models attached to a controller
* and generate a fixture list.
*
* @return void
**/
function _processController(&$subject) {
$subject->constructClasses();
$models = array(Inflector::classify($subject->name));
if (!empty($subject->uses)) {
$models = $subject->uses;
}
foreach ($models as $model) {
$this->_processModel($subject->{$model});
}
}
/**
* Add classname to the fixture list.
* Sets the app. or plugin.plugin_name. prefix.