Skip to content

Commit 36a9407

Browse files
committed
test: Support -dev versions for apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent ca988f4 commit 36a9407

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

tests/Core/Command/Apps/AppsDisableTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,22 @@ public function testCommandInput($appId, $statusCode, $pattern): void {
5252
$this->assertSame($statusCode, $this->commandTester->getStatusCode());
5353
}
5454

55+
public const VERSION_REGEX = '([\d\.\-dev]*)';
56+
5557
public static function dataCommandInput(): array {
5658
return [
57-
[['admin_audit'], 0, 'admin_audit ([\d\.]*) disabled'],
58-
[['comments'], 0, 'comments ([\d\.]*) disabled'],
59+
[['admin_audit'], 0, 'admin_audit ' . self::VERSION_REGEX . ' disabled'],
60+
[['comments'], 0, 'comments ' . self::VERSION_REGEX . ' disabled'],
5961
[['invalid_app'], 0, 'No such app enabled: invalid_app'],
6062

61-
[['admin_audit', 'comments'], 0, "admin_audit ([\d\.]*) disabled\ncomments ([\d\.]*) disabled"],
62-
[['admin_audit', 'comments', 'invalid_app'], 0, "admin_audit ([\d\.]*) disabled\ncomments ([\d\.]*) disabled\nNo such app enabled: invalid_app"],
63+
[['admin_audit', 'comments'], 0, 'admin_audit ' . self::VERSION_REGEX . " disabled\ncomments " . self::VERSION_REGEX . ' disabled'],
64+
[['admin_audit', 'comments', 'invalid_app'], 0, 'admin_audit ' . self::VERSION_REGEX . " disabled\ncomments " . self::VERSION_REGEX . " disabled\nNo such app enabled: invalid_app"],
6365

6466
[['files'], 2, "files can't be disabled"],
6567
[['provisioning_api'], 2, "provisioning_api can't be disabled"],
6668

67-
[['files', 'admin_audit'], 2, "files can't be disabled.\nadmin_audit ([\d\.]*) disabled"],
68-
[['provisioning_api', 'comments'], 2, "provisioning_api can't be disabled.\ncomments ([\d\.]*) disabled"],
69+
[['files', 'admin_audit'], 2, "files can't be disabled.\nadmin_audit " . self::VERSION_REGEX . ' disabled'],
70+
[['provisioning_api', 'comments'], 2, "provisioning_api can't be disabled.\ncomments " . self::VERSION_REGEX . ' disabled'],
6971
];
7072
}
7173
}

tests/Core/Command/Apps/AppsEnableTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,27 @@ public function testCommandInput($appId, $groups, $statusCode, $pattern): void {
6060
$this->assertSame($statusCode, $this->commandTester->getStatusCode());
6161
}
6262

63+
public const VERSION_REGEX = '([\d\.\-dev]*)';
64+
6365
public static function dataCommandInput(): array {
6466
return [
65-
[['admin_audit'], null, 0, 'admin_audit ([\d\.]*) enabled'],
66-
[['comments'], null, 0, 'comments ([\d\.]*) enabled'],
67-
[['comments', 'comments'], null, 0, "comments ([\d\.]*) enabled\ncomments already enabled"],
67+
[['admin_audit'], null, 0, 'admin_audit ' . self::VERSION_REGEX . ' enabled'],
68+
[['comments'], null, 0, 'comments ' . self::VERSION_REGEX . ' enabled'],
69+
[['comments', 'comments'], null, 0, 'comments ' . self::VERSION_REGEX . " enabled\ncomments already enabled"],
6870
[['invalid_app'], null, 1, 'Could not download app invalid_app'],
6971

70-
[['admin_audit', 'comments'], null, 0, "admin_audit ([\d\.]*) enabled\ncomments ([\d\.]*) enabled"],
71-
[['admin_audit', 'comments', 'invalid_app'], null, 1, "admin_audit ([\d\.]*) enabled\ncomments ([\d\.]*) enabled\nCould not download app invalid_app"],
72+
[['admin_audit', 'comments'], null, 0, 'admin_audit ' . self::VERSION_REGEX . " enabled\ncomments " . self::VERSION_REGEX . ' enabled'],
73+
[['admin_audit', 'comments', 'invalid_app'], null, 1, 'admin_audit ' . self::VERSION_REGEX . " enabled\ncomments " . self::VERSION_REGEX . " enabled\nCould not download app invalid_app"],
7274

7375
[['admin_audit'], ['admin'], 1, "admin_audit can't be enabled for groups"],
7476
[['comments'], ['admin'], 1, "comments can't be enabled for groups"],
7577

76-
[['updatenotification'], ['admin'], 0, 'updatenotification ([\d\.]*) enabled for groups: admin'],
77-
[['updatenotification', 'dashboard'], ['admin'], 0, "updatenotification ([\d\.]*) enabled for groups: admin\ndashboard ([\d\.]*) enabled for groups: admin"],
78+
[['updatenotification'], ['admin'], 0, 'updatenotification ' . self::VERSION_REGEX . ' enabled for groups: admin'],
79+
[['updatenotification', 'dashboard'], ['admin'], 0, 'updatenotification ' . self::VERSION_REGEX . " enabled for groups: admin\ndashboard " . self::VERSION_REGEX . ' enabled for groups: admin'],
7880

79-
[['updatenotification'], ['admin', 'invalid_group'], 0, 'updatenotification ([\d\.]*) enabled for groups: admin'],
80-
[['updatenotification', 'dashboard'], ['admin', 'invalid_group'], 0, "updatenotification ([\d\.]*) enabled for groups: admin\ndashboard ([\d\.]*) enabled for groups: admin"],
81-
[['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"],
81+
[['updatenotification'], ['admin', 'invalid_group'], 0, 'updatenotification ' . self::VERSION_REGEX . ' enabled for groups: admin'],
82+
[['updatenotification', 'dashboard'], ['admin', 'invalid_group'], 0, 'updatenotification ' . self::VERSION_REGEX . " enabled for groups: admin\ndashboard " . self::VERSION_REGEX . ' enabled for groups: admin'],
83+
[['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"],
8284
];
8385
}
8486
}

0 commit comments

Comments
 (0)