From 9305094b8b10a3160dc2200934e86010fadd9a02 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 9 Nov 2016 10:49:57 +0100 Subject: [PATCH] Add test and adjust PHP function arguments Signed-off-by: Lukas Reschke --- lib/private/RichObjectStrings/Validator.php | 2 +- tests/lib/RichObjectStrings/DefinitionsTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php index de7afa7a7e..11d17fef64 100644 --- a/lib/private/RichObjectStrings/Validator.php +++ b/lib/private/RichObjectStrings/Validator.php @@ -97,7 +97,7 @@ class Validator implements IValidator { * @param array $definition * @return string[] */ - protected function getRequiredParameters($type, $definition) { + protected function getRequiredParameters($type, array $definition) { if (isset($this->requiredParameters[$type])) { return $this->requiredParameters[$type]; } diff --git a/tests/lib/RichObjectStrings/DefinitionsTest.php b/tests/lib/RichObjectStrings/DefinitionsTest.php index e226ffcd3f..e0d400bff2 100644 --- a/tests/lib/RichObjectStrings/DefinitionsTest.php +++ b/tests/lib/RichObjectStrings/DefinitionsTest.php @@ -36,6 +36,15 @@ class DefinitionsTest extends TestCase { return $testsuite; } + /** + * @expectedException \OCP\RichObjectStrings\InvalidObjectExeption + * @expectedExceptionMessage Object type is undefined + */ + public function testGetDefinitionNotExisting() { + $definitions = new Definitions(); + $definitions->getDefinition('NotExistingType'); + } + /** * @dataProvider dataGetDefinition * @param string $type