mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Removing a duplicate test, and extra classes.
This commit is contained in:
parent
339cb41ea2
commit
95f58321a8
1 changed files with 2 additions and 65 deletions
|
@ -20,52 +20,6 @@
|
||||||
App::import('Controller', 'Controller', false);
|
App::import('Controller', 'Controller', false);
|
||||||
App::import('Controller', 'Component', 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
|
* ParamTestComponent
|
||||||
*
|
*
|
||||||
|
@ -115,7 +69,7 @@ class ParamTestComponent extends Component {
|
||||||
* @package cake
|
* @package cake
|
||||||
* @subpackage cake.tests.cases.libs.controller
|
* @subpackage cake.tests.cases.libs.controller
|
||||||
*/
|
*/
|
||||||
class ComponentTestController extends AppController {
|
class ComponentTestController extends Controller {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* name property
|
* name property
|
||||||
|
@ -132,6 +86,7 @@ class ComponentTestController extends AppController {
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public $uses = array();
|
public $uses = array();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -396,22 +351,4 @@ class ComponentTest extends CakeTestCase {
|
||||||
$this->assertType('ComponentTestController', $Controller->SomethingWithEmail->Email->Controller);
|
$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')));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue