Skip to content

Commit

Permalink
Adding support for AppFixtureManager as well as option flag selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 14, 2011
1 parent d20f68c commit 51dcb18
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cake/tests/lib/cake_test_runner.php
Expand Up @@ -79,13 +79,15 @@ protected function createTestResult() {
* @return instance of a fixture manager.
*/
protected function _getFixtureManager($arguments) {
if (!isset($arguments['fixtureManager'])) {
return new CakeFixtureManager();
if (isset($arguments['fixtureManager'])) {
if (App::import('Lib', 'test_suite/' . Inflector::underscore($arguments['fixtureManager']))) {
return new $arguments['fixtureManager'];
}
throw new RuntimeException(__('Could not find fixture manager %s.', $arguments['fixtureManager']));
}
App::import('Lib', 'test_suite/' . Inflector::underscore($arguments['fixtureManager']));
if (class_exists($arguments['fixtureManager'])) {
return new $arguments['fixtureManager'];
if (App::import('Lib', 'test_suite/AppFixtureManager')) {
return new AppFixtureManager();
}
throw new RuntimeException('No fixture manager found.');
return new CakeFixtureManager();
}
}

0 comments on commit 51dcb18

Please sign in to comment.