aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-09 10:49:57 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-11-09 10:49:57 +0100
commit9305094b8b10a3160dc2200934e86010fadd9a02 (patch)
tree8a0bbab1fee9fe7b170e2d3fd3b4cfbecbe8f809
parent92e5fb4053eaa27984db6f6ddb7eaf028a46525b (diff)
downloadnextcloud-server-9305094b8b10a3160dc2200934e86010fadd9a02.tar.gz
nextcloud-server-9305094b8b10a3160dc2200934e86010fadd9a02.zip
Add test and adjust PHP function arguments
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r--lib/private/RichObjectStrings/Validator.php2
-rw-r--r--tests/lib/RichObjectStrings/DefinitionsTest.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/RichObjectStrings/Validator.php b/lib/private/RichObjectStrings/Validator.php
index de7afa7a7e3..11d17fef645 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 e226ffcd3fd..e0d400bff2c 100644
--- a/tests/lib/RichObjectStrings/DefinitionsTest.php
+++ b/tests/lib/RichObjectStrings/DefinitionsTest.php
@@ -37,6 +37,15 @@ class DefinitionsTest extends TestCase {
}
/**
+ * @expectedException \OCP\RichObjectStrings\InvalidObjectExeption
+ * @expectedExceptionMessage Object type is undefined
+ */
+ public function testGetDefinitionNotExisting() {
+ $definitions = new Definitions();
+ $definitions->getDefinition('NotExistingType');
+ }
+
+ /**
* @dataProvider dataGetDefinition
* @param string $type
* @param array $expected