Skip to content

Commit

Permalink
Update tests to not be skipped and test alternative URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 11, 2013
1 parent 932b221 commit fcf5ad5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
24 changes: 14 additions & 10 deletions Cake/Test/TestApp/Controller/RequestActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@
class RequestActionController extends AppController {

/**
* uses property
* modelClass property
*
* @var array
* @access public
* @var string
*/
public $uses = ['Post'];
public $modelClass = 'Posts';

/**
* test_request_action method
*
* @access public
* @return void
* @return string
*/
public function test_request_action() {
return 'This is a test';
Expand All @@ -47,7 +45,7 @@ public function test_request_action() {
* @param mixed $id
* @param mixed $other
* @access public
* @return void
* @return string
*/
public function another_ra_test($id, $other) {
return $id + $other;
Expand All @@ -56,7 +54,7 @@ public function another_ra_test($id, $other) {
/**
* normal_request_action method
*
* @return void
* @return string
*/
public function normal_request_action() {
return 'Hello World';
Expand All @@ -65,7 +63,7 @@ public function normal_request_action() {
/**
* returns $this->here
*
* @return void
* @return string
*/
public function return_here() {
return $this->here;
Expand All @@ -74,7 +72,7 @@ public function return_here() {
/**
* paginate_request_action method
*
* @return void
* @return boolean
*/
public function paginate_request_action() {
$data = $this->paginate();
Expand Down Expand Up @@ -108,6 +106,11 @@ public function params_pass() {
return $this->request;
}

/**
* param check method.
*
* @return void
*/
public function param_check() {
$this->autoRender = false;
$content = '';
Expand All @@ -116,4 +119,5 @@ public function param_check() {
}
$this->response->body($content);
}

}
8 changes: 7 additions & 1 deletion Cake/Test/TestCase/Routing/RequestActionTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class RequestActionTraitTest extends TestCase {
*/
public function setUp() {
parent::setUp();
$this->markTestIncomplete('Need to revisit once models work again.');
Configure::write('App.namespace', 'TestApp');
Configure::write('Security.salt', 'not-the-default');
$this->object = $this->getObjectForTrait('Cake\Routing\RequestActionTrait');
Expand Down Expand Up @@ -231,6 +230,13 @@ public function testRequestActionWithQueryString() {
);
$this->assertEquals($query, $result);

$result = $this->object->requestAction([
'controller' => 'request_action',
'action' => 'query_pass',
'?' => $query
]);
$this->assertEquals($query, $result);

$result = $this->object->requestAction(
'/request_action/query_pass?page=3&sort=body'
);
Expand Down

0 comments on commit fcf5ad5

Please sign in to comment.