Add test and adjust PHP function arguments

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-11-09 10:49:57 +01:00
parent 92e5fb4053
commit 9305094b8b
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 10 additions and 1 deletions

View 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];
}

View 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