Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Affecting the REQUEST_METHOD env variable in order to ease controller…

… testing with different http verbs
  • Loading branch information...
commit 40ba4005bdc9b0a50febf27e3273052718fbeaf7 1 parent f94394f
@lorenzo lorenzo authored
View
1  lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
@@ -390,6 +390,7 @@ public function testTestActionPostData() {
$result = $this->Case->testAction('/tests_apps_posts/add', array('return' => 'vars'));
$this->assertTrue(array_key_exists('posts', $result));
$this->assertEqual(count($result['posts']), 4);
+ $this->assertTrue($this->Case->controller->request->is('post'));
}
/**
View
1  lib/Cake/TestSuite/ControllerTestCase.php
@@ -190,6 +190,7 @@ protected function _testAction($url = '', $options = array()) {
'return' => 'result'
), $options);
+ $_SERVER['REQUEST_METHOD'] = strtoupper($options['method']);
if (strtoupper($options['method']) == 'GET') {
$_GET = $options['data'];
$_POST = array();
Please sign in to comment.
Something went wrong with that request. Please try again.