diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-04-12 22:26:09 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-04-13 12:00:18 +0200 |
commit | 31ae39c5690b3d69226fdd5e02b7efd72f8fb9d2 (patch) | |
tree | 886d58da2f0ca71e3281303b82854708ddd869fa /tests/lib/AppFramework | |
parent | 3d425ce833a995908faecf8f2ce052a266dd416b (diff) | |
download | nextcloud-server-31ae39c5690b3d69226fdd5e02b7efd72f8fb9d2.tar.gz nextcloud-server-31ae39c5690b3d69226fdd5e02b7efd72f8fb9d2.zip |
Add tests for multiple parameters
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'tests/lib/AppFramework')
-rw-r--r-- | tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php index 644245e1967..3c43e7f9219 100644 --- a/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php +++ b/tests/lib/AppFramework/Utility/ControllerMethodReflectorTest.php @@ -75,18 +75,32 @@ class ControllerMethodReflectorTest extends \Test\TestCase { $this->assertTrue($reader->hasAnnotation('Annotation')); } + /** + * @Annotation(parameter=value) + */ + public function testGetAnnotationParameterSingle() { + $reader = new ControllerMethodReflector(); + $reader->reflect( + __CLASS__, + __FUNCTION__ + ); + + $this->assertSame('value', $reader->getAnnotationParameter('Annotation', 'parameter')); + } /** - * @Annotation parameter + * @Annotation(parameter1=value1, parameter2=value2,parameter3=value3) */ - public function testGetAnnotationParameter(){ + public function testGetAnnotationParameterMultiple() { $reader = new ControllerMethodReflector(); $reader->reflect( - '\Test\AppFramework\Utility\ControllerMethodReflectorTest', - 'testGetAnnotationParameter' + __CLASS__, + __FUNCTION__ ); - $this->assertSame('parameter', $reader->getAnnotationParameter('Annotation')); + $this->assertSame('value1', $reader->getAnnotationParameter('Annotation', 'parameter1')); + $this->assertSame('value2', $reader->getAnnotationParameter('Annotation', 'parameter2')); + $this->assertSame('value3', $reader->getAnnotationParameter('Annotation', 'parameter3')); } /** |