Skip to content

Commit

Permalink
Removing classes that were not used in the ErrorHandler test case. Ad…
Browse files Browse the repository at this point in the history
…ding a new test suite for error classes.
  • Loading branch information
markstory committed Nov 26, 2010
1 parent e2c8e20 commit fac222e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 124 deletions.
45 changes: 45 additions & 0 deletions cake/tests/cases/libs/all_error.test.php
@@ -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;
}
}
125 changes: 1 addition & 124 deletions cake/tests/cases/libs/error_handler.test.php
Expand Up @@ -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
Expand Down

0 comments on commit fac222e

Please sign in to comment.