Update info checker requirements

This commit is contained in:
Joas Schilling 2016-02-11 11:25:50 +01:00
parent 5165998723
commit 8cfdc62eae
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']]],
];
}