Upgrade CakePHP from 2.2.5 to 2.9.5

This commit is contained in:
Brm Ko 2017-02-26 15:29:44 +01:00
parent 5a580df460
commit 235a541597
793 changed files with 60746 additions and 23753 deletions

View file

@ -2,20 +2,22 @@
/**
* CakeBaseReporter contains common functionality to all cake test suite reporters.
*
* PHP 5
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* 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
* @since CakePHP(tm) v 1.3
* @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/ResultPrinter.php';
if (!defined('__PHPUNIT_PHAR__')) {
require_once 'PHPUnit/TextUI/ResultPrinter.php';
}
/**
* CakeBaseReporter contains common reporting features used in the CakePHP Test suite
@ -24,10 +26,15 @@ require_once 'PHPUnit/TextUI/ResultPrinter.php';
*/
class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Headers sent
*
* @var bool
*/
protected $_headerSent = false;
/**
* Array of request parameters. Usually parsed GET params.
* Array of request parameters. Usually parsed GET params.
*
* @var array
*/
@ -104,7 +111,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Get the baseUrl if one is available.
*
* @return string The base url for the request.
* @return string The base URL for the request.
*/
public function baseUrl() {
if (!empty($_SERVER['PHP_SELF'])) {
@ -113,10 +120,22 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
return '';
}
/**
* Print result
*
* @param PHPUnit_Framework_TestResult $result The result object
* @return void
*/
public function printResult(PHPUnit_Framework_TestResult $result) {
$this->paintFooter($result);
}
/**
* Paint result
*
* @param PHPUnit_Framework_TestResult $result The result object
* @return void
*/
public function paintResult(PHPUnit_Framework_TestResult $result) {
$this->paintFooter($result);
}
@ -124,9 +143,10 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* An error occurred.
*
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
* @param PHPUnit_Framework_Test $test The test to add an error for.
* @param Exception $e The exception object to add.
* @param float $time The current time.
* @return void
*/
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintException($e, $test);
@ -135,9 +155,10 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A failure occurred.
*
* @param PHPUnit_Framework_Test $test
* @param PHPUnit_Framework_AssertionFailedError $e
* @param float $time
* @param PHPUnit_Framework_Test $test The test that failed
* @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed.
* @param float $time The current time.
* @return void
*/
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
$this->paintFail($e, $test);
@ -146,9 +167,10 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Incomplete test.
*
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
* @param PHPUnit_Framework_Test $test The test that was incomplete.
* @param Exception $e The incomplete exception
* @param float $time The current time.
* @return void
*/
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintSkip($e, $test);
@ -157,9 +179,10 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Skipped test.
*
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
* @param PHPUnit_Framework_Test $test The test that failed.
* @param Exception $e The skip object.
* @param float $time The current time.
* @return void
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
$this->paintSkip($e, $test);
@ -168,7 +191,8 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite
* @param PHPUnit_Framework_TestSuite $suite The suite to start
* @return void
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
if (!$this->_headerSent) {
@ -180,7 +204,8 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite
* @param PHPUnit_Framework_TestSuite $suite The suite that ended.
* @return void
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
}
@ -188,7 +213,8 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test started.
*
* @param PHPUnit_Framework_Test $test
* @param PHPUnit_Framework_Test $test The test that started.
* @return void
*/
public function startTest(PHPUnit_Framework_Test $test) {
}
@ -196,8 +222,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test
* @param float $time
* @param PHPUnit_Framework_Test $test The test that ended
* @param float $time The current time.
* @return void
*/
public function endTest(PHPUnit_Framework_Test $test, $time) {
$this->numAssertions += $test->getNumAssertions();