Removing classes that were not used in the ErrorHandler test case. Adding a new test suite for error classes.

This commit is contained in:
mark_story 2010-11-14 22:24:29 -05:00
parent e2c8e20afa
commit fac222e2cd
2 changed files with 46 additions and 124 deletions

View 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;
}
}

View file

@ -18,130 +18,7 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', array('ErrorHandler', 'Controller', 'Component'));
/**
* 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 { }
App::import('Core', 'ErrorHandler');
/**
* ErrorHandlerTest class