aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-12-15 09:33:52 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-12-15 09:33:52 +0100
commitb6dd1a1d7b5a5eb8c5af4b1b793b06a1725bb53a (patch)
treebb3c12be762c6a0f3ef132f191eb7b8fbd535ada /tests
parent0d6a706bc08e40fad013bc7f0d07e6c0b71d27f9 (diff)
downloadnextcloud-server-b6dd1a1d7b5a5eb8c5af4b1b793b06a1725bb53a.tar.gz
nextcloud-server-b6dd1a1d7b5a5eb8c5af4b1b793b06a1725bb53a.zip
fix(app framework): Fix missing cast of double controller parameters
``settype`` allows 'double' as alias of 'float'. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AppFramework/Http/DispatcherTest.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php
index 8f591f26e58..016bd7efb58 100644
--- a/tests/lib/AppFramework/Http/DispatcherTest.php
+++ b/tests/lib/AppFramework/Http/DispatcherTest.php
@@ -51,11 +51,12 @@ class TestController extends Controller {
/**
* @param int $int
* @param bool $bool
+ * @param double $foo
* @param int $test
- * @param int $test2
+ * @param integer $test2
* @return array
*/
- public function exec($int, $bool, $test = 4, $test2 = 1) {
+ public function exec($int, $bool, $foo, $test = 4, $test2 = 1) {
$this->registerResponder('text', function ($in) {
return new JSONResponse(['text' => $in]);
});
@@ -315,7 +316,8 @@ class DispatcherTest extends \Test\TestCase {
[
'post' => [
'int' => '3',
- 'bool' => 'false'
+ 'bool' => 'false',
+ 'double' => 1.2,
],
'method' => 'POST'
],
@@ -346,6 +348,7 @@ class DispatcherTest extends \Test\TestCase {
'post' => [
'int' => '3',
'bool' => 'false',
+ 'double' => 1.2,
'test2' => 7
],
'method' => 'POST',
@@ -377,7 +380,8 @@ class DispatcherTest extends \Test\TestCase {
[
'post' => [
'int' => '3',
- 'bool' => 'false'
+ 'bool' => 'false',
+ 'double' => 1.2,
],
'urlParams' => [
'format' => 'text'
@@ -410,7 +414,8 @@ class DispatcherTest extends \Test\TestCase {
[
'post' => [
'int' => '3',
- 'bool' => 'false'
+ 'bool' => 'false',
+ 'double' => 1.2,
],
'urlParams' => [
'format' => 'json'
@@ -443,7 +448,8 @@ class DispatcherTest extends \Test\TestCase {
[
'post' => [
'int' => '3',
- 'bool' => 'false'
+ 'bool' => 'false',
+ 'double' => 1.2,
],
'server' => [
'HTTP_ACCEPT' => 'application/text, test',
@@ -477,7 +483,8 @@ class DispatcherTest extends \Test\TestCase {
[
'post' => [
'int' => '3',
- 'bool' => 'false'
+ 'bool' => 'false',
+ 'double' => 1.2,
],
'get' => [
'format' => 'text'