mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 08:58:25 +00:00
"Refactoring Component tests.
Removed Component::!__construct();" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6374 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
6419ee2bc7
commit
654669d48f
2 changed files with 10 additions and 13 deletions
|
@ -44,14 +44,6 @@ class Component extends Object {
|
|||
* @access public
|
||||
*/
|
||||
var $controller = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function __construct() {
|
||||
}
|
||||
/**
|
||||
* Used to initialize the components for current controller
|
||||
*
|
||||
|
|
|
@ -47,7 +47,7 @@ class ComponentTest extends CakeTestCase {
|
|||
$Controller = new ComponentTestController();
|
||||
$Controller->components = array('RequestHandler');
|
||||
|
||||
$Component = new Component($Controller);
|
||||
$Component = new Component();
|
||||
$Component->init($Controller);
|
||||
|
||||
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
|
||||
|
@ -56,6 +56,7 @@ class ComponentTest extends CakeTestCase {
|
|||
$Controller->plugin = 'test_plugin';
|
||||
$Controller->components = array('RequestHandler', 'TestPluginComponent');
|
||||
|
||||
$Component = new Component();
|
||||
$Component->init($Controller);
|
||||
|
||||
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
|
||||
|
@ -66,14 +67,18 @@ class ComponentTest extends CakeTestCase {
|
|||
$Controller = new ComponentTestController();
|
||||
$Controller->components = array('Security');
|
||||
|
||||
$result = $Component->init($Controller);
|
||||
$this->assertTrue(is_object($Controller->Security));
|
||||
$this->assertTrue(is_object($Controller->Security->Session));
|
||||
$Component = new Component();
|
||||
$Component->init($Controller);
|
||||
|
||||
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
|
||||
$this->assertTrue(is_a($Controller->Security->Session, 'SessionComponent'));
|
||||
|
||||
$Controller = new ComponentTestController();
|
||||
$Controller->components = array('Security', 'Cookie', 'RequestHandler');
|
||||
|
||||
$result = $Component->init($Controller);
|
||||
$Component = new Component();
|
||||
$Component->init($Controller);
|
||||
|
||||
$this->assertTrue(is_a($Controller->Security, 'SecurityComponent'));
|
||||
$this->assertTrue(is_a($Controller->Security->RequestHandler, 'RequestHandlerComponent'));
|
||||
$this->assertTrue(is_a($Controller->RequestHandler, 'RequestHandlerComponent'));
|
||||
|
|
Loading…
Add table
Reference in a new issue