Skip to content

Commit

Permalink
Fix failing tests from moving RequestAction into a trait.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 3, 2012
1 parent 23fc75a commit 7cc0872
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
5 changes: 1 addition & 4 deletions lib/Cake/Controller/Component.php
@@ -1,8 +1,5 @@
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -11,11 +8,11 @@
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Controller
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace Cake\Controller;

use Cake\Core\Object;

/**
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/Controller/Component/RequestHandlerComponent.php
Expand Up @@ -26,6 +26,7 @@
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Error;
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\Utility\Xml;
Expand All @@ -43,6 +44,8 @@
*/
class RequestHandlerComponent extends Component {

use RequestActionTrait;

/**
* The layout that will be switched to for Ajax requests
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/Controller/Controller.php
Expand Up @@ -25,6 +25,7 @@
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Routing\Router;
use Cake\Routing\RequestActionTrait;
use Cake\Utility\ClassRegistry;
use Cake\Utility\Inflector;
use Cake\Utility\MergeVariablesTrait;
Expand Down Expand Up @@ -65,6 +66,7 @@
class Controller extends Object implements EventListener {

use MergeVariablesTrait;
use RequestActionTrait;

/**
* The name of this controller. Controller names are plural, named after the model they manipulate.
Expand Down
Expand Up @@ -94,14 +94,14 @@ public function testSessionIdConsistentAcrossRequestAction() {
$Session->check('Test');
$this->assertTrue(isset($_SESSION));

$Object = new Object();
$Controller = new Controller();
$Session = new SessionComponent($this->ComponentCollection);
$expected = $Session->id();

$result = $Object->requestAction('/session_test/session_id');
$result = $Controller->requestAction('/session_test/session_id');
$this->assertEquals($expected, $result);

$result = $Object->requestAction('/orange_session_test/session_id');
$result = $Controller->requestAction('/orange_session_test/session_id');
$this->assertEquals($expected, $result);
}

Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/View/View.php
Expand Up @@ -29,6 +29,7 @@
use Cake\Event\EventManager;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Routing\RequestActionTrait;
use Cake\Routing\Router;
use Cake\Utility\Inflector;
use Cake\Utility\ObjectCollection;
Expand Down Expand Up @@ -64,6 +65,8 @@
*/
class View extends Object {

use RequestActionTrait;

/**
* Helpers collection
*
Expand Down

0 comments on commit 7cc0872

Please sign in to comment.