]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add test and adjust PHP function arguments 2052/head
authorLukas Reschke <lukas@statuscode.ch>
Wed, 9 Nov 2016 09:49:57 +0000 (10:49 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Wed, 9 Nov 2016 09:49:57 +0000 (10:49 +0100)
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
lib/private/RichObjectStrings/Validator.php
tests/lib/RichObjectStrings/DefinitionsTest.php

index de7afa7a7e3154f2e167a5ac5d135d5a7cac0247..11d17fef645b01a64fc9f0470c4564c91701aa71 100644 (file)
@@ -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];
                }
index e226ffcd3fdd78335aea1a1ed603efc0f4486e35..e0d400bff2c3e7f48a4503c6c8a4848e97782dd1 100644 (file)
@@ -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