mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Starting to move test suite manipulation methods into CakeTestSuite.
This commit is contained in:
parent
ca167d5da2
commit
d7b958f55d
1 changed files with 20 additions and 1 deletions
|
@ -26,7 +26,8 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
|
||||||
protected $_fixtureManager = null;
|
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
|
* @param CakeFixtureManager $manager the instance of the manager class
|
||||||
* @return void
|
* @return void
|
||||||
* @access public
|
* @access public
|
||||||
|
@ -35,6 +36,24 @@ class CakeTestSuite extends PHPUnit_Framework_TestSuite {
|
||||||
$this->_fixtureManager = $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.
|
* Method that is called before the tests of this test suite are run.
|
||||||
* It will load fixtures accordingly for each test
|
* It will load fixtures accordingly for each test
|
||||||
|
|
Loading…
Add table
Reference in a new issue