summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-01-15 14:19:56 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-01-15 15:22:52 +0100
commitbb0c88a577e67e7537a32f0e63ab00403fe3531c (patch)
tree148ed0db1fdcf16752839dc0bfc6112b5c8531b1 /tests
parent2fbe8bbcba2e6387669f0028cb5a3d314336efe4 (diff)
downloadnextcloud-server-bb0c88a577e67e7537a32f0e63ab00403fe3531c.tar.gz
nextcloud-server-bb0c88a577e67e7537a32f0e63ab00403fe3531c.zip
always set url parameters when they are available in the app dispatch
prefer url parameters passed into the main method. If they are not present, use the containers urlParameters add space
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/appframework/http/RequestTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index caa22c84415..85db76efe71 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -214,4 +214,21 @@ class RequestTest extends \Test\TestCase {
$this->fail('Expected LogicException.');
}
+
+
+ public function testSetUrlParameters() {
+ $vars = array(
+ 'post' => array(),
+ 'method' => 'POST',
+ 'urlParams' => array('id' => '2'),
+ );
+
+ $request = new Request($vars, $this->stream);
+
+ $newParams = array('id' => '3', 'test' => 'test2');
+ $request->setUrlParameters($newParams);
+ $this->assertEquals('test2', $request->getParam('test'));
+ $this->assertEquals('3', $request->getParam('id'));
+ $this->assertEquals('3', $request->getParams()['id']);
+ }
}