mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Merge pull request #5248 from larryb82/phpunit_as_phar
PHPUnit can be included as a phar file.
This commit is contained in:
commit
1fed92d94c
4 changed files with 15 additions and 3 deletions
|
@ -15,7 +15,9 @@
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'PHPUnit/TextUI/TestRunner.php';
|
if (!defined('__PHPUNIT_PHAR__')) {
|
||||||
|
require_once 'PHPUnit/TextUI/TestRunner.php';
|
||||||
|
}
|
||||||
|
|
||||||
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
|
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'PHPUnit/TextUI/Command.php';
|
if (!defined('__PHPUNIT_PHAR__')) {
|
||||||
|
require_once 'PHPUnit/TextUI/Command.php';
|
||||||
|
}
|
||||||
|
|
||||||
App::uses('CakeTestRunner', 'TestSuite');
|
App::uses('CakeTestRunner', 'TestSuite');
|
||||||
App::uses('CakeTestLoader', 'TestSuite');
|
App::uses('CakeTestLoader', 'TestSuite');
|
||||||
|
|
|
@ -151,6 +151,12 @@ class CakeTestSuiteDispatcher {
|
||||||
} elseif (is_dir($vendor . DS . 'PHPUnit')) {
|
} elseif (is_dir($vendor . DS . 'PHPUnit')) {
|
||||||
ini_set('include_path', $vendor . PATH_SEPARATOR . ini_get('include_path'));
|
ini_set('include_path', $vendor . PATH_SEPARATOR . ini_get('include_path'));
|
||||||
break;
|
break;
|
||||||
|
} elseif (is_file($vendor . DS . 'phpunit.phar')) {
|
||||||
|
$backup = $GLOBALS['_SERVER']['SCRIPT_NAME'];
|
||||||
|
$GLOBALS['_SERVER']['SCRIPT_NAME'] = '-';
|
||||||
|
$included = include_once $vendor . DS . 'phpunit.phar';
|
||||||
|
$GLOBALS['_SERVER']['SCRIPT_NAME'] = $backup;
|
||||||
|
return $included;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include 'PHPUnit' . DS . 'Autoload.php';
|
include 'PHPUnit' . DS . 'Autoload.php';
|
||||||
|
|
|
@ -15,7 +15,9 @@
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'PHPUnit/TextUI/ResultPrinter.php';
|
if (!defined('__PHPUNIT_PHAR__')) {
|
||||||
|
require_once 'PHPUnit/TextUI/ResultPrinter.php';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CakeBaseReporter contains common reporting features used in the CakePHP Test suite
|
* CakeBaseReporter contains common reporting features used in the CakePHP Test suite
|
||||||
|
|
Loading…
Reference in a new issue