mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 21:24:27 +02:00
Fix warning if author or maintainer is missing in addon info
This commit is contained in:
parent
d88119139f
commit
6a058793f0
2 changed files with 57 additions and 4 deletions
|
@ -74,12 +74,16 @@ final class AddonInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// rename author to authors
|
// rename author to authors
|
||||||
$data['authors'] = $data['author'];
|
if (array_key_exists('author', $data)) {
|
||||||
unset($data['author']);
|
$data['authors'] = $data['author'];
|
||||||
|
unset($data['author']);
|
||||||
|
}
|
||||||
|
|
||||||
// rename maintainer to maintainers
|
// rename maintainer to maintainers
|
||||||
$data['maintainers'] = $data['maintainer'];
|
if (array_key_exists('maintainer', $data)) {
|
||||||
unset($data['maintainer']);
|
$data['maintainers'] = $data['maintainer'];
|
||||||
|
unset($data['maintainer']);
|
||||||
|
}
|
||||||
|
|
||||||
return self::fromArray($data);
|
return self::fromArray($data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,55 @@ class AddonInfoTest extends TestCase
|
||||||
'',
|
'',
|
||||||
['id' => 'test'],
|
['id' => 'test'],
|
||||||
],
|
],
|
||||||
|
'without-author' => [
|
||||||
|
'test',
|
||||||
|
<<<TEXT
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Name: Test Addon
|
||||||
|
* Description: adds awesome features to friendica
|
||||||
|
* Version: 100.4.50-beta.5
|
||||||
|
* Maintainer: Robin
|
||||||
|
* Status: beta
|
||||||
|
* Ignore: The "ignore" key is unsupported and will be ignored
|
||||||
|
*/
|
||||||
|
TEXT,
|
||||||
|
[
|
||||||
|
'id' => 'test',
|
||||||
|
'name' => 'Test Addon',
|
||||||
|
'description' => 'adds awesome features to friendica',
|
||||||
|
|
||||||
|
'maintainers' => [
|
||||||
|
['name' => 'Robin'],
|
||||||
|
],
|
||||||
|
'version' => '100.4.50-beta.5',
|
||||||
|
'status' => 'beta',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'without-maintainer' => [
|
||||||
|
'test',
|
||||||
|
<<<TEXT
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Name: Test Addon
|
||||||
|
* Description: adds awesome features to friendica
|
||||||
|
* Version: 100.4.50-beta.5
|
||||||
|
* Author: Sam
|
||||||
|
* Status: beta
|
||||||
|
* Ignore: The "ignore" key is unsupported and will be ignored
|
||||||
|
*/
|
||||||
|
TEXT,
|
||||||
|
[
|
||||||
|
'id' => 'test',
|
||||||
|
'name' => 'Test Addon',
|
||||||
|
'description' => 'adds awesome features to friendica',
|
||||||
|
'authors' => [
|
||||||
|
['name' => 'Sam'],
|
||||||
|
],
|
||||||
|
'version' => '100.4.50-beta.5',
|
||||||
|
'status' => 'beta',
|
||||||
|
],
|
||||||
|
],
|
||||||
'complete' => [
|
'complete' => [
|
||||||
'test',
|
'test',
|
||||||
<<<TEXT
|
<<<TEXT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue