Skip to content

Commit fcf5ad5

Browse files
committed
Update tests to not be skipped and test alternative URLs.
1 parent 932b221 commit fcf5ad5

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

Cake/Test/TestApp/Controller/RequestActionController.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@
2424
class RequestActionController extends AppController {
2525

2626
/**
27-
* uses property
27+
* modelClass property
2828
*
29-
* @var array
30-
* @access public
29+
* @var string
3130
*/
32-
public $uses = ['Post'];
31+
public $modelClass = 'Posts';
3332

3433
/**
3534
* test_request_action method
3635
*
37-
* @access public
38-
* @return void
36+
* @return string
3937
*/
4038
public function test_request_action() {
4139
return 'This is a test';
@@ -47,7 +45,7 @@ public function test_request_action() {
4745
* @param mixed $id
4846
* @param mixed $other
4947
* @access public
50-
* @return void
48+
* @return string
5149
*/
5250
public function another_ra_test($id, $other) {
5351
return $id + $other;
@@ -56,7 +54,7 @@ public function another_ra_test($id, $other) {
5654
/**
5755
* normal_request_action method
5856
*
59-
* @return void
57+
* @return string
6058
*/
6159
public function normal_request_action() {
6260
return 'Hello World';
@@ -65,7 +63,7 @@ public function normal_request_action() {
6563
/**
6664
* returns $this->here
6765
*
68-
* @return void
66+
* @return string
6967
*/
7068
public function return_here() {
7169
return $this->here;
@@ -74,7 +72,7 @@ public function return_here() {
7472
/**
7573
* paginate_request_action method
7674
*
77-
* @return void
75+
* @return boolean
7876
*/
7977
public function paginate_request_action() {
8078
$data = $this->paginate();
@@ -108,6 +106,11 @@ public function params_pass() {
108106
return $this->request;
109107
}
110108

109+
/**
110+
* param check method.
111+
*
112+
* @return void
113+
*/
111114
public function param_check() {
112115
$this->autoRender = false;
113116
$content = '';
@@ -116,4 +119,5 @@ public function param_check() {
116119
}
117120
$this->response->body($content);
118121
}
122+
119123
}

Cake/Test/TestCase/Routing/RequestActionTraitTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class RequestActionTraitTest extends TestCase {
3838
*/
3939
public function setUp() {
4040
parent::setUp();
41-
$this->markTestIncomplete('Need to revisit once models work again.');
4241
Configure::write('App.namespace', 'TestApp');
4342
Configure::write('Security.salt', 'not-the-default');
4443
$this->object = $this->getObjectForTrait('Cake\Routing\RequestActionTrait');
@@ -231,6 +230,13 @@ public function testRequestActionWithQueryString() {
231230
);
232231
$this->assertEquals($query, $result);
233232

233+
$result = $this->object->requestAction([
234+
'controller' => 'request_action',
235+
'action' => 'query_pass',
236+
'?' => $query
237+
]);
238+
$this->assertEquals($query, $result);
239+
234240
$result = $this->object->requestAction(
235241
'/request_action/query_pass?page=3&sort=body'
236242
);

0 commit comments

Comments
 (0)