Skip to content

Commit

Permalink
Starting to move test suite manipulation methods into CakeTestSuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 25, 2010
1 parent ca167d5 commit d7b958f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cake/tests/lib/cake_test_suite.php
Expand Up @@ -26,7 +26,8 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
protected $_fixtureManager = null;

/**
* Sets the intances for the fixture manager that will be used by this class
* Sets the intances for the fixture manager that will be used by this class.
*
* @param CakeFixtureManager $manager the instance of the manager class
* @return void
* @access public
Expand All @@ -35,6 +36,24 @@ public function setFixtureManager(CakeFixtureManager $manager) {
$this->_fixtureManager = $manager;
}

/**
* Adds all the files in a directory to the test suite. Does not recurse through directories.
*
* @param string $directory The directory to add tests from.
* @return void
*/
public function addTestDirectory($directory = '.') {
$files = new DirectoryIterator($directory);

foreach ($files as $file) {
if (!$file->isFile()) {
continue;
}
$file = $file->getRealPath();
$this->addTestFile($file);
}
}

/**
* Method that is called before the tests of this test suite are run.
* It will load fixtures accordingly for each test
Expand Down

0 comments on commit d7b958f

Please sign in to comment.