summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-28 10:21:14 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-28 10:21:14 +0100
commiteb509bcbe6d6b97133a7b4dfba81325e92500aed (patch)
treeea48a8a74bf2c11b774ca40242d7c774703e9824 /tests
parent245dac7e81e0192a4de7e51652c94b19f036a2ed (diff)
parentb2df7b6b8ae420766f1ce0a7b22e153f9ee1b23e (diff)
downloadnextcloud-server-eb509bcbe6d6b97133a7b4dfba81325e92500aed.tar.gz
nextcloud-server-eb509bcbe6d6b97133a7b4dfba81325e92500aed.zip
Merge pull request #17333 from owncloud/php7-scalar-types-controllers
Prefer scalar type hints over phpdoc annotation
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/appframework/utility/ControllerMethodReflectorTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
index a584b5481ba..c643c362a9c 100644
--- a/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
+++ b/tests/lib/appframework/utility/ControllerMethodReflectorTest.php
@@ -104,6 +104,29 @@ class ControllerMethodReflectorTest extends \Test\TestCase {
$this->assertEquals('int', $reader->getType('test'));
}
+ /**
+ * @Annotation
+ * @param int $a
+ * @param int $b
+ */
+ public function arguments3($a, float $b, int $c, $d){}
+
+ /**
+ * @requires PHP 7
+ */
+ public function testReadTypeIntAnnotationsScalarTypes(){
+ $reader = new ControllerMethodReflector();
+ $reader->reflect(
+ '\OC\AppFramework\Utility\ControllerMethodReflectorTest',
+ 'arguments3'
+ );
+
+ $this->assertEquals('int', $reader->getType('a'));
+ $this->assertEquals('float', $reader->getType('b'));
+ $this->assertEquals('int', $reader->getType('c'));
+ $this->assertNull($reader->getType('d'));
+ }
+
/**
* @Annotation