mirror of
https://github.com/brmlab/brmsklad.git
synced 2025-08-02 22:23:38 +02:00
Upgrade CakePHP from 2.2.5 to 2.9.5
This commit is contained in:
parent
5a580df460
commit
235a541597
793 changed files with 60746 additions and 23753 deletions
|
@ -2,22 +2,23 @@
|
|||
/**
|
||||
* TestRunner for CakePHP Test suite.
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package Cake.TestSuite
|
||||
* @since CakePHP(tm) v 2.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
* @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('CakeTestLoader', 'TestSuite');
|
||||
|
@ -36,6 +37,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
/**
|
||||
* Construct method
|
||||
*
|
||||
* @param mixed $loader The loader instance to use.
|
||||
* @param array $params list of options to be used for this run
|
||||
* @throws MissingTestLoaderException When a loader class could not be found.
|
||||
*/
|
||||
|
@ -53,10 +55,11 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
}
|
||||
|
||||
/**
|
||||
* Ugly hack to get around PHPUnit having a hard coded classname for the Runner. :(
|
||||
* Ugly hack to get around PHPUnit having a hard coded class name for the Runner. :(
|
||||
*
|
||||
* @param array $argv
|
||||
* @param boolean $exit
|
||||
* @param array $argv The command arguments
|
||||
* @param bool $exit The exit mode.
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $argv, $exit = true) {
|
||||
$this->handleArguments($argv);
|
||||
|
@ -73,24 +76,6 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
);
|
||||
}
|
||||
|
||||
if (count($suite) == 0) {
|
||||
$skeleton = new PHPUnit_Util_Skeleton_Test(
|
||||
$suite->getName(),
|
||||
$this->arguments['testFile']
|
||||
);
|
||||
|
||||
$result = $skeleton->generate(true);
|
||||
|
||||
if (!$result['incomplete']) {
|
||||
//@codingStandardsIgnoreStart
|
||||
eval(str_replace(array('<?php', '?>'), '', $result['code']));
|
||||
//@codingStandardsIgnoreEnd
|
||||
$suite = new PHPUnit_Framework_TestSuite(
|
||||
$this->arguments['test'] . 'Test'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->arguments['listGroups']) {
|
||||
PHPUnit_TextUI_TestRunner::printVersionString();
|
||||
|
||||
|
@ -120,20 +105,19 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
|
||||
} elseif (!isset($result) || $result->errorCount() > 0) {
|
||||
exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
|
||||
} else {
|
||||
exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);
|
||||
}
|
||||
exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a runner for the command.
|
||||
*
|
||||
* @param $loader The loader to be used for the test run.
|
||||
* @param mixed $loader The loader to be used for the test run.
|
||||
* @return CakeTestRunner
|
||||
*/
|
||||
public function getRunner($loader) {
|
||||
return new CakeTestRunner($loader, $this->_params);
|
||||
return new CakeTestRunner($loader, $this->_params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,12 +133,12 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
/**
|
||||
* Handles output flag used to change printing on webrunner.
|
||||
*
|
||||
* @param string $reporter The reporter class to use.
|
||||
* @return void
|
||||
*/
|
||||
public function handleReporter($reporter) {
|
||||
$object = null;
|
||||
|
||||
$type = strtolower($reporter);
|
||||
$reporter = ucwords($reporter);
|
||||
$coreClass = 'Cake' . $reporter . 'Reporter';
|
||||
App::uses($coreClass, 'TestSuite/Reporter');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue