mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing classes that were not used in the ErrorHandler test case. Adding a new test suite for error classes.
This commit is contained in:
parent
e2c8e20afa
commit
fac222e2cd
2 changed files with 46 additions and 124 deletions
45
cake/tests/cases/libs/all_error.test.php
Normal file
45
cake/tests/cases/libs/all_error.test.php
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* AllErrorTest file
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.cases
|
||||||
|
* @since CakePHP(tm) v 2.0
|
||||||
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AllErrorTest class
|
||||||
|
*
|
||||||
|
* This test group will run error handling related tests.
|
||||||
|
*
|
||||||
|
* @package cake
|
||||||
|
* @subpackage cake.tests.groups
|
||||||
|
*/
|
||||||
|
class AllErrorTest extends PHPUnit_Framework_TestSuite {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* suite method, defines tests for this suite.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function suite() {
|
||||||
|
$suite = new PHPUnit_Framework_TestSuite('All Error handling tests');
|
||||||
|
|
||||||
|
$libs = CORE_TEST_CASES . DS . 'libs' . DS;
|
||||||
|
|
||||||
|
$suite->addTestFile($libs . 'error_handler.test.php');
|
||||||
|
$suite->addTestFile($libs . 'exception_renderer.test.php');
|
||||||
|
return $suite;
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,130 +18,7 @@
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::import('Core', array('ErrorHandler', 'Controller', 'Component'));
|
App::import('Core', 'ErrorHandler');
|
||||||
|
|
||||||
/**
|
|
||||||
* Short description for class.
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
*/
|
|
||||||
class AuthBlueberryUser extends CakeTestModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* name property
|
|
||||||
*
|
|
||||||
* @var string 'AuthBlueberryUser'
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $name = 'AuthBlueberryUser';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* useTable property
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $useTable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BlueberryComponent class
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
*/
|
|
||||||
class BlueberryComponent extends Component {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* testName property
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public $testName = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* initialize method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function initialize(&$controller) {
|
|
||||||
$this->testName = 'BlueberryComponent';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TestErrorController class
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
*/
|
|
||||||
class TestErrorController extends Controller {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uses property
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $uses = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* components property
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public $components = array('Blueberry');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* beforeRender method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function beforeRender() {
|
|
||||||
echo $this->Blueberry->testName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* index method
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function index() {
|
|
||||||
$this->autoRender = false;
|
|
||||||
return 'what up';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MyCustomErrorHandler class
|
|
||||||
*
|
|
||||||
* @package cake
|
|
||||||
* @subpackage cake.tests.cases.libs
|
|
||||||
*/
|
|
||||||
class MyCustomErrorHandler extends ErrorHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* custom error message type.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function missingWidgetThing() {
|
|
||||||
echo 'widget thing is missing';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Exception class for testing app error handlers and custom errors.
|
|
||||||
*
|
|
||||||
* @package cake.test.cases.libs
|
|
||||||
*/
|
|
||||||
class MissingWidgetThingException extends NotFoundException { }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ErrorHandlerTest class
|
* ErrorHandlerTest class
|
||||||
|
|
Loading…
Reference in a new issue