Skip to content

Commit

Permalink
Removing a duplicate test, and extra classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 16, 2010
1 parent 339cb41 commit 95f5832
Showing 1 changed file with 2 additions and 65 deletions.
67 changes: 2 additions & 65 deletions cake/tests/cases/libs/controller/component.test.php
Expand Up @@ -20,52 +20,6 @@
App::import('Controller', 'Controller', false);
App::import('Controller', 'Component', false);

if (!class_exists('AppController')) {

/**
* AppController class
*
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class AppController extends Controller {

/**
* name property
*
* @var string 'App'
* @access public
*/
public $name = 'App';

/**
* uses property
*
* @var array
* @access public
*/
public $uses = array();

/**
* helpers property
*
* @var array
* @access public
*/
public $helpers = array();

/**
* components property
*
* @var array
* @access public
*/
public $components = array('Orange' => array('colour' => 'blood orange'));
}
} elseif (!defined('APP_CONTROLLER_EXISTS')){
define('APP_CONTROLLER_EXISTS', true);
}

/**
* ParamTestComponent
*
Expand Down Expand Up @@ -115,7 +69,7 @@ function initialize(&$controller, $settings) {
* @package cake
* @subpackage cake.tests.cases.libs.controller
*/
class ComponentTestController extends AppController {
class ComponentTestController extends Controller {

/**
* name property
Expand All @@ -132,6 +86,7 @@ class ComponentTestController extends AppController {
* @access public
*/
public $uses = array();

}

/**
Expand Down Expand Up @@ -396,22 +351,4 @@ function testSomethingReferencingEmailComponent() {
$this->assertType('ComponentTestController', $Controller->SomethingWithEmail->Email->Controller);
}

/**
* Test that SessionComponent doesn't get added if its already in the components array.
*
* @return void
*/
public function testDoubleLoadingOfSessionComponent() {
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
return;
}

$Controller = new ComponentTestController();
$Controller->uses = false;
$Controller->components = array('Session');
$Controller->constructClasses();

$this->assertEqual($Controller->components, array('Session' => '', 'Orange' => array('colour' => 'blood orange')));
}

}

0 comments on commit 95f5832

Please sign in to comment.