Merge pull request #22315 from owncloud/update-info-checker-requirements

Update info checker requirements
This commit is contained in:
Thomas Müller 2016-02-11 14:31:47 +01:00
commit dfe267424f
2 changed files with 6 additions and 13 deletions

View File

@ -41,21 +41,22 @@ class InfoChecker extends BasicEmitter {
'bugs',
'category',
'default_enable',
'dependencies',
'dependencies', // TODO: Mandatory as of ownCloud 11
'documentation',
'namespace',
'ocsid',
'public',
'remote',
'repository',
'require',
'requiremin',
'types',
'version',
'website',
];
private $deprecatedFields = [
'info',
'require',
'requiremax',
'requiremin',
'shipped',
'standalone',
];
@ -137,7 +138,7 @@ class InfoChecker extends BasicEmitter {
$versionFile = $appPath . '/appinfo/version';
if (is_file($versionFile)) {
$version = trim(file_get_contents($versionFile));
if(isset($info['version'])) {
if (isset($info['version'])) {
if($info['version'] !== $version) {
$this->emit('InfoChecker', 'differentVersions',
[$version, $info['version']]);
@ -152,14 +153,6 @@ class InfoChecker extends BasicEmitter {
} else {
$this->emit('InfoChecker', 'migrateVersion', [$version]);
}
} else {
if(!isset($info['version'])) {
$this->emit('InfoChecker', 'mandatoryFieldMissing', ['version']);
$errors[] = [
'type' => 'mandatoryFieldMissing',
'field' => 'version',
];
}
}
return $errors;

View File

@ -54,7 +54,7 @@ class InfoCheckerTest extends TestCase {
['testapp-version', []],
['testapp-infoxml-version', []],
['testapp-infoxml-version-different', [['type' => 'differentVersions', 'message' => 'appinfo/version: 1.2.4 - appinfo/info.xml: 1.2.3']]],
['testapp-version-missing', [['type' => 'mandatoryFieldMissing', 'field' => 'version']]],
['testapp-version-missing', []],
['testapp-name-missing', [['type' => 'mandatoryFieldMissing', 'field' => 'name']]],
];
}