2010-07-07 04:40:28 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* TestRunner for CakePHP Test suite.
|
|
|
|
*
|
|
|
|
* PHP 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2010-12-24 18:57:20 +00:00
|
|
|
* @package cake.tests.libs
|
2010-07-07 04:40:28 +00:00
|
|
|
* @since CakePHP(tm) v 2.0
|
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
|
|
|
*/
|
2011-02-12 21:08:48 +00:00
|
|
|
require 'PHPUnit/TextUI/TestRunner.php';
|
2010-07-07 04:40:28 +00:00
|
|
|
|
2010-09-28 03:07:23 +00:00
|
|
|
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
2010-07-07 04:40:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class to customize loading of test suites from CLI
|
|
|
|
*
|
2010-12-24 18:57:20 +00:00
|
|
|
* @package cake.tests.lib
|
2010-07-07 04:40:28 +00:00
|
|
|
*/
|
2011-02-12 21:08:48 +00:00
|
|
|
class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
2010-07-07 04:40:28 +00:00
|
|
|
|
2011-02-12 21:45:26 +00:00
|
|
|
public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array()) {
|
|
|
|
$fixture = new CakeFixtureManager;
|
|
|
|
foreach ($suite->getIterator() as $test) {
|
|
|
|
if ($test instanceof CakeTestCase) {
|
|
|
|
$fixture->fixturize($test);
|
|
|
|
$test->fixtureManager = $fixture;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$r = parent::doRun($suite, $arguments);
|
|
|
|
$fixture->shutdown();
|
|
|
|
return $r;
|
2010-07-07 04:40:28 +00:00
|
|
|
}
|
|
|
|
}
|