mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing several errors when running the testsuite
This commit is contained in:
parent
4389764050
commit
8e5bd76752
23 changed files with 37 additions and 24 deletions
|
@ -285,8 +285,7 @@ class App {
|
|||
|
||||
if (!empty($paths[$type])) {
|
||||
$path = array_flip(array_flip(array_merge(
|
||||
(array)$paths[$type], self::$__packages[$type], $merge
|
||||
)));
|
||||
(array)$paths[$type], self::$__packages[$type])));
|
||||
self::$__packages[$type] = array_values($path);
|
||||
} else {
|
||||
$path = array_flip(array_flip(self::$__packages[$type]));
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* @since CakePHP(tm) v 1.2.0.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('ObjectCollection', 'Core');
|
||||
App::uses('ObjectCollection', 'Utility');
|
||||
|
||||
/**
|
||||
* Model behavior collection class.
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('DataSource', 'Model/Datasource');
|
||||
App::uses('String', 'Utility');
|
||||
App::uses('View', 'View');
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('CakeSocket', 'Core');
|
||||
App::uses('Router', 'Core');
|
||||
App::uses('Router', 'Routing');
|
||||
|
||||
/**
|
||||
* Cake network socket connection class.
|
||||
|
|
|
@ -286,7 +286,7 @@ class Router {
|
|||
* @return array Array of routes
|
||||
*/
|
||||
public static function redirect($route, $url, $options) {
|
||||
App::uses('RedirectRoute', 'Core');
|
||||
App::uses('RedirectRoute', 'Routing/Route');
|
||||
$options['routeClass'] = 'RedirectRoute';
|
||||
return self::connect($route, $url, $options);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
||||
|
||||
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
|
||||
App::uses('CakeTestModel', 'TestSuite/Fixture');
|
||||
App::uses('CakeTestFixture', 'TestSuite/Fixture');
|
||||
|
||||
/**
|
||||
|
@ -30,7 +29,7 @@ App::uses('CakeTestFixture', 'TestSuite/Fixture');
|
|||
* @package cake
|
||||
* @subpackage cake.cake.tests.lib
|
||||
*/
|
||||
class CakeTestCase extends PHPUnit_Framework_TestCase {
|
||||
abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
||||
|
||||
/**
|
||||
* The class responsible for managinf the creation, loading and removing of fixtures
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('TestManager', 'TestSuite');
|
||||
/**
|
||||
* CakeTestSuiteDispatcher handles web requests to the test suite and runs the correct action.
|
||||
*
|
||||
|
@ -201,7 +202,6 @@ class CakeTestSuiteDispatcher {
|
|||
*/
|
||||
function &getManager() {
|
||||
if (empty($this->Manager)) {
|
||||
require_once CAKE_TESTS_LIB . 'test_manager.php';
|
||||
$this->Manager = new $this->_managerClass($this->params);
|
||||
}
|
||||
return $this->Manager;
|
||||
|
@ -217,13 +217,13 @@ class CakeTestSuiteDispatcher {
|
|||
if (!self::$_Reporter) {
|
||||
$type = strtolower($this->params['output']);
|
||||
$coreClass = 'Cake' . ucwords($this->params['output']) . 'Reporter';
|
||||
$coreFile = CAKE_TESTS_LIB . 'reporter/cake_' . $type . '_reporter.php';
|
||||
|
||||
$appClass = $this->params['output'] . 'Reporter';
|
||||
$appFile = APPLIBS . 'test_suite/reporter/' . $type . '_reporter.php';
|
||||
if (include_once $coreFile) {
|
||||
App::uses($coreClass, 'TestSuite/Reporter');
|
||||
App::uses($appClass, 'TestSuite/Reporter');
|
||||
|
||||
if (class_exists($coreClass)) {
|
||||
self::$_Reporter = new $coreClass(null, $this->params);
|
||||
} elseif (include_once $appFile) {
|
||||
} elseif (class_exists($appClass)) {
|
||||
self::$_Reporter = new $appClass(null, $this->params);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,10 +17,11 @@
|
|||
* @since CakePHP(tm) v 2.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
require_once dirname(__FILE__) . '/base_coverage_report.php';
|
||||
|
||||
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
||||
|
||||
App::uses('BaseCoverageReport', 'TestSuite/Coverage');
|
||||
|
||||
class HtmlCoverageReport extends BaseCoverageReport {
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
*/
|
||||
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
||||
|
||||
App::uses('ConnectionManager', 'Model');
|
||||
App::uses('ClassRegistry', 'Utility');
|
||||
|
||||
class CakeFixtureManager {
|
||||
|
||||
/**
|
||||
|
@ -100,6 +103,7 @@ class CakeFixtureManager {
|
|||
if (isset($this->_loaded[$fixture])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strpos($fixture, 'core.') === 0) {
|
||||
$fixture = substr($fixture, strlen('core.'));
|
||||
foreach (App::core('cake') as $key => $path) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* @since CakePHP(tm) v 1.2.0.4433
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
include_once dirname(__FILE__) . DS . 'cake_base_reporter.php';
|
||||
App::uses('CakeBaseReporter', 'TestSuite/Reporter');
|
||||
|
||||
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
||||
|
||||
|
|
|
@ -23,9 +23,11 @@ define('APP_TEST_CASES', TESTS . 'cases');
|
|||
define('APP_TEST_GROUPS', TESTS . 'groups');
|
||||
|
||||
PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');
|
||||
|
||||
App::uses('CakeTestSuite', 'TestSuite');
|
||||
App::uses('CakeTestCase', 'TestSuite');
|
||||
App::uses('CakeFixtureManager', 'TestSuite/Fixture');
|
||||
App::uses('CakeTestModel', 'TestSuite/Fixture');
|
||||
|
||||
/**
|
||||
* TestManager is the base class that handles loading and initiating the running
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('Router', 'Core');
|
||||
App::uses('Router', 'Routing');
|
||||
|
||||
/**
|
||||
* Abstract base class for all other Helpers in CakePHP.
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('JsHelper', 'Helper');
|
||||
App::uses('JsHelper', 'View/Helper');
|
||||
App::uses('JsBaseEngineHelper', 'View/Helper');
|
||||
|
||||
class JqueryEngineHelper extends JsBaseEngineHelper {
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* @since CakePHP(tm) v 2.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('ObjectCollection', 'Core');
|
||||
App::uses('ObjectCollection', 'Utility');
|
||||
|
||||
class HelperCollection extends ObjectCollection {
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* Included libraries.
|
||||
*/
|
||||
App::uses('HelperCollection', 'View');
|
||||
App::uses('Router', 'Routing');
|
||||
|
||||
/**
|
||||
* View, the V in the MVC triad.
|
||||
|
|
|
@ -145,7 +145,7 @@ if (!defined('CAKE_TESTS')) {
|
|||
/**
|
||||
* Path to the test suite.
|
||||
*/
|
||||
define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS);
|
||||
define('CAKE_TESTS_LIB', LIBS . 'TestSuite' . DS);
|
||||
|
||||
/**
|
||||
* Path to the controller test directory.
|
||||
|
|
|
@ -24,7 +24,7 @@ App::uses('Controller', 'Controller');
|
|||
App::uses('CakeHtmlReporter', 'TestSuite/Reporter');
|
||||
|
||||
if (!class_exists('AppController', false)) {
|
||||
require_once LIBS . 'Controller' . DS . 'app_controller.php';
|
||||
require_once LIBS . 'Controller' . DS . 'AppController.php';
|
||||
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
|
||||
define('APP_CONTROLLER_EXISTS', true);
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ if (!class_exists('AppController', false)) {
|
|||
class CakeTestCaseTest extends CakeTestCase {
|
||||
|
||||
public static function setUpBeforeClass() {
|
||||
require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php';
|
||||
require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php';
|
||||
require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php';
|
||||
require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('DboSource', 'Model/Datasource');
|
||||
App::uses('Model', 'Model');
|
||||
|
||||
/**
|
||||
* CakeTestFixtureTestFixture class
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
require_once CAKE . 'tests' . DS . 'lib' . DS . 'coverage' . DS . 'html_coverage_report.php';
|
||||
App::uses('HtmlCoverageReport', 'TestSuite/Coverage');
|
||||
|
||||
class HtmlCoverageReportTest extends CakeTestCase {
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
App::uses('Set', 'Utility');
|
||||
App::uses('Model', 'Model');
|
||||
|
||||
/**
|
||||
* SetTest class
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
App::uses('View', 'View');
|
||||
App::uses('Helper', 'View');
|
||||
App::uses('Model', 'Model');
|
||||
App::uses('Router', 'Routing');
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,8 +17,9 @@
|
|||
* @since CakePHP(tm) v 1.2.0.4206
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
App::uses('View', 'View');
|
||||
App::uses('TextHelper', 'Helper');
|
||||
App::uses('TextHelper', 'View/Helper');
|
||||
|
||||
/**
|
||||
* TextHelperTest class
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
App::uses('View', 'View');
|
||||
App::uses('Helper', 'View');
|
||||
App::uses('Controller', 'Controller');
|
||||
App::uses('CacheHelper', 'View/Helper');
|
||||
App::uses('ErrorHandler', 'Error');
|
||||
|
|
Loading…
Reference in a new issue