diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-28 10:21:14 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-28 10:21:14 +0100 |
commit | eb509bcbe6d6b97133a7b4dfba81325e92500aed (patch) | |
tree | ea48a8a74bf2c11b774ca40242d7c774703e9824 /tests | |
parent | 245dac7e81e0192a4de7e51652c94b19f036a2ed (diff) | |
parent | b2df7b6b8ae420766f1ce0a7b22e153f9ee1b23e (diff) | |
download | nextcloud-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.php | 23 |
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 |