mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
test: Support -dev versions for apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
ca988f4eac
commit
36a94070d1
2 changed files with 20 additions and 16 deletions
|
|
@ -52,20 +52,22 @@ class AppsDisableTest extends TestCase {
|
|||
$this->assertSame($statusCode, $this->commandTester->getStatusCode());
|
||||
}
|
||||
|
||||
public const VERSION_REGEX = '([\d\.\-dev]*)';
|
||||
|
||||
public static function dataCommandInput(): array {
|
||||
return [
|
||||
[['admin_audit'], 0, 'admin_audit ([\d\.]*) disabled'],
|
||||
[['comments'], 0, 'comments ([\d\.]*) disabled'],
|
||||
[['admin_audit'], 0, 'admin_audit ' . self::VERSION_REGEX . ' disabled'],
|
||||
[['comments'], 0, 'comments ' . self::VERSION_REGEX . ' disabled'],
|
||||
[['invalid_app'], 0, 'No such app enabled: invalid_app'],
|
||||
|
||||
[['admin_audit', 'comments'], 0, "admin_audit ([\d\.]*) disabled\ncomments ([\d\.]*) disabled"],
|
||||
[['admin_audit', 'comments', 'invalid_app'], 0, "admin_audit ([\d\.]*) disabled\ncomments ([\d\.]*) disabled\nNo such app enabled: invalid_app"],
|
||||
[['admin_audit', 'comments'], 0, 'admin_audit ' . self::VERSION_REGEX . " disabled\ncomments " . self::VERSION_REGEX . ' disabled'],
|
||||
[['admin_audit', 'comments', 'invalid_app'], 0, 'admin_audit ' . self::VERSION_REGEX . " disabled\ncomments " . self::VERSION_REGEX . " disabled\nNo such app enabled: invalid_app"],
|
||||
|
||||
[['files'], 2, "files can't be disabled"],
|
||||
[['provisioning_api'], 2, "provisioning_api can't be disabled"],
|
||||
|
||||
[['files', 'admin_audit'], 2, "files can't be disabled.\nadmin_audit ([\d\.]*) disabled"],
|
||||
[['provisioning_api', 'comments'], 2, "provisioning_api can't be disabled.\ncomments ([\d\.]*) disabled"],
|
||||
[['files', 'admin_audit'], 2, "files can't be disabled.\nadmin_audit " . self::VERSION_REGEX . ' disabled'],
|
||||
[['provisioning_api', 'comments'], 2, "provisioning_api can't be disabled.\ncomments " . self::VERSION_REGEX . ' disabled'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,25 +60,27 @@ class AppsEnableTest extends TestCase {
|
|||
$this->assertSame($statusCode, $this->commandTester->getStatusCode());
|
||||
}
|
||||
|
||||
public const VERSION_REGEX = '([\d\.\-dev]*)';
|
||||
|
||||
public static function dataCommandInput(): array {
|
||||
return [
|
||||
[['admin_audit'], null, 0, 'admin_audit ([\d\.]*) enabled'],
|
||||
[['comments'], null, 0, 'comments ([\d\.]*) enabled'],
|
||||
[['comments', 'comments'], null, 0, "comments ([\d\.]*) enabled\ncomments already enabled"],
|
||||
[['admin_audit'], null, 0, 'admin_audit ' . self::VERSION_REGEX . ' enabled'],
|
||||
[['comments'], null, 0, 'comments ' . self::VERSION_REGEX . ' enabled'],
|
||||
[['comments', 'comments'], null, 0, 'comments ' . self::VERSION_REGEX . " enabled\ncomments already enabled"],
|
||||
[['invalid_app'], null, 1, 'Could not download app invalid_app'],
|
||||
|
||||
[['admin_audit', 'comments'], null, 0, "admin_audit ([\d\.]*) enabled\ncomments ([\d\.]*) enabled"],
|
||||
[['admin_audit', 'comments', 'invalid_app'], null, 1, "admin_audit ([\d\.]*) enabled\ncomments ([\d\.]*) enabled\nCould not download app invalid_app"],
|
||||
[['admin_audit', 'comments'], null, 0, 'admin_audit ' . self::VERSION_REGEX . " enabled\ncomments " . self::VERSION_REGEX . ' enabled'],
|
||||
[['admin_audit', 'comments', 'invalid_app'], null, 1, 'admin_audit ' . self::VERSION_REGEX . " enabled\ncomments " . self::VERSION_REGEX . " enabled\nCould not download app invalid_app"],
|
||||
|
||||
[['admin_audit'], ['admin'], 1, "admin_audit can't be enabled for groups"],
|
||||
[['comments'], ['admin'], 1, "comments can't be enabled for groups"],
|
||||
|
||||
[['updatenotification'], ['admin'], 0, 'updatenotification ([\d\.]*) enabled for groups: admin'],
|
||||
[['updatenotification', 'dashboard'], ['admin'], 0, "updatenotification ([\d\.]*) enabled for groups: admin\ndashboard ([\d\.]*) enabled for groups: admin"],
|
||||
[['updatenotification'], ['admin'], 0, 'updatenotification ' . self::VERSION_REGEX . ' enabled for groups: admin'],
|
||||
[['updatenotification', 'dashboard'], ['admin'], 0, 'updatenotification ' . self::VERSION_REGEX . " enabled for groups: admin\ndashboard " . self::VERSION_REGEX . ' enabled for groups: admin'],
|
||||
|
||||
[['updatenotification'], ['admin', 'invalid_group'], 0, 'updatenotification ([\d\.]*) enabled for groups: admin'],
|
||||
[['updatenotification', 'dashboard'], ['admin', 'invalid_group'], 0, "updatenotification ([\d\.]*) enabled for groups: admin\ndashboard ([\d\.]*) enabled for groups: admin"],
|
||||
[['updatenotification', 'dashboard', 'invalid_app'], ['admin', 'invalid_group'], 1, "updatenotification ([\d\.]*) enabled for groups: admin\ndashboard ([\d\.]*) enabled for groups: admin\nCould not download app invalid_app"],
|
||||
[['updatenotification'], ['admin', 'invalid_group'], 0, 'updatenotification ' . self::VERSION_REGEX . ' enabled for groups: admin'],
|
||||
[['updatenotification', 'dashboard'], ['admin', 'invalid_group'], 0, 'updatenotification ' . self::VERSION_REGEX . " enabled for groups: admin\ndashboard " . self::VERSION_REGEX . ' enabled for groups: admin'],
|
||||
[['updatenotification', 'dashboard', 'invalid_app'], ['admin', 'invalid_group'], 1, 'updatenotification ' . self::VERSION_REGEX . " enabled for groups: admin\ndashboard " . self::VERSION_REGEX . " enabled for groups: admin\nCould not download app invalid_app"],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue