Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Fixing the RequestProxyController test
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Jan 10, 2012
1 parent 3081856 commit 2fb2a7f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Test/Case/Lib/RequestProxy/RequestProxyControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RequestProxyControllerTest extends CakeTestCase {
*/
public function testHeaderParsed() {
$request = null;
$requestProxyController = & new RequestProxyController($request);
$requestProxyController = &new RequestProxyController($request);
$_ENV['Authorization'] = "OAuth realm=\"\", oauth_nonce=\"225579211881198842005988698334675835446\", oauth_signature_method=\"HMAC-SHA1\", oauth_token=\"token_411a7f\", oauth_timestamp=\"1199645624\", oauth_consumer_key=\"consumer_key_86cad9\", oauth_signature=\"26g7wHTtNO6ZWJaLltcueppHYiI%3D\", oauth_version=\"1.0\"";
$required = array('oauth_consumer_key' => 'consumer_key_86cad9',
'oauth_nonce' => '225579211881198842005988698334675835446',
Expand All @@ -46,8 +46,9 @@ public function testHeaderParsed() {
* @return void
*/
public function testParametersParsed() {
$request = & new OauthLibAppController();
$request->params['url'] = array('test' => 'data');
$cakeRequest = new CakeRequest();
$request = &new OauthLibAppController($cakeRequest);
$request->request->params['url'] = array('test' => 'data');
$requestProxyController = & new RequestProxyController($request);
$_ENV['Authorization'] = "OAuth realm=\"\", oauth_nonce=\"225579211881198842005988698334675835446\", oauth_signature_method=\"HMAC-SHA1\", oauth_token=\"token_411a7f\", oauth_timestamp=\"1199645624\", oauth_consumer_key=\"consumer_key_86cad9\", oauth_signature=\"26g7wHTtNO6ZWJaLltcueppHYiI%3D\", oauth_version=\"1.0\"";
$required = array('oauth_consumer_key' => 'consumer_key_86cad9',
Expand All @@ -69,9 +70,8 @@ public function testParametersParsed() {
$_SERVER['HTTPS'] = null;
$_SERVER['SERVER_PORT'] = 8080;
$this->assertEqual($requestProxyController->uri(), 'http://www.org:8080/test');

$_SERVER['REQUEST_METHOD'] = 'GET';

$this->assertEqual($requestProxyController->method(), 'GET');
}

Expand All @@ -83,10 +83,11 @@ public function testParametersParsed() {
* @return void
*/
protected function _getRequestProxy($parameters, $options = array()) {
$request = & new OauthLibAppController();
$cakeRequest = new CakeRequest();
$request = &new OauthLibAppController($cakeRequest);
$request->request->data = $parameters;
$request->request->params['url'] = array('url' => '/', 'ext' => 'html');
$_ENV['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
$_ENV['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
$_ENV['Authorization'] = null;
return RequestFactory::proxy($request, $options);
}
Expand Down

0 comments on commit 2fb2a7f

Please sign in to comment.