Skip to content
Permalink
Browse files

Inline constructClasses().

Remove the actual method body for constructClasses() as it is no longer
needed. I've left a no-op method to make life easier for people if they
are following 3.0.*-dev. Removing the method now would cause seemingly
random test failures now. Instead I'd prefer to remove these methods
after we've done a release announcing their removal.
  • Loading branch information...
markstory committed Sep 15, 2014
1 parent 059bdc7 commit 3f110d095e68f2baafd0ffcb34d444f84db85908
Showing with 7 additions and 25 deletions.
  1. +7 −9 src/Controller/Controller.php
  2. +0 −16 tests/TestCase/Controller/ControllerTest.php
@@ -270,8 +270,11 @@ public function __construct(Request $request = null, Response $response = null,
$modelClass = ($this->plugin ? $this->plugin . '.' : '') . $this->name;
$this->_setModelClass($modelClass);
$this->constructClasses();
$this->initialize();
$this->_mergeControllerVars();
$this->_loadComponents();
$this->eventManager()->attach($this);
}
/**
@@ -443,19 +446,14 @@ public function implementedEvents() {
}
/**
* Loads Model and Component classes.
* No-op for backwards compatibility.
*
* Using the $components properties, classes are loaded
* and components have their callbacks attached to the EventManager.
* It is also at this time that Controller callbacks are bound.
* The code that used to live here is now in Controller::__construct().
*
* @deprecated 3.0.0 Will be removed in 3.0.0.
* @return void
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::constructClasses
*/
public function constructClasses() {
$this->_mergeControllerVars();
$this->_loadComponents();
$this->eventManager()->attach($this);
}
/**
@@ -528,22 +528,6 @@ public function testMergeVars() {
);
}
/**
* Ensure that _mergeControllerVars is not being greedy and merging with
* ControllerTestAppController when you make an instance of Controller
*
* @return void
*/
public function testMergeVarsNotGreedy() {
$request = new Request('controller_posts/index');
$Controller = new Controller($request);
$Controller->components = [];
$Controller->constructClasses();
$this->assertFalse(isset($Controller->Session));
}
/**
* testReferer method
*

0 comments on commit 3f110d0

Please sign in to comment.
You can’t perform that action at this time.