Fix test by defining plurals

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-04-14 14:46:07 +02:00
parent 2228b285c5
commit 79ebc7f24c
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 5 additions and 1 deletions

View File

@ -126,6 +126,10 @@ class ManagerTest extends \Test\TestCase {
->willReturnCallback(function ($text, $parameters = []) { ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters); return vsprintf($text, $parameters);
}); });
$this->l->method('n')
->willReturnCallback(function ($singular, $plural, $count, $parameters = []) {
return vsprintf(str_replace('%n', $count, ($count === 1) ? $singular : $plural), $parameters);
});
$this->factory = new DummyFactory(\OC::$server); $this->factory = new DummyFactory(\OC::$server);
@ -1957,7 +1961,7 @@ class ManagerTest extends \Test\TestCase {
$data = []; $data = [];
// No exclude groups // No exclude groups
$data[] = ['no', null, null, null, false]; $data[] = ['no', null, null, [], false];
// empty exclude list, user no groups // empty exclude list, user no groups
$data[] = ['yes', '', json_encode(['']), [], false]; $data[] = ['yes', '', json_encode(['']), [], false];