Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-09-16 12:03:44 +0300
committerJoas Schilling <coding@schilljs.com>2022-09-16 12:03:44 +0300
commit3009e023249fc1ec68dae101c1abd4ca52c03125 (patch)
tree9fe60ba001b119bc93ed5319f9c6bbfbce041b51 /apps
parent9c402eb745c39a2b5122f45cdd1c3e673b72850a (diff)
Fix phpunit
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php b/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
index d23b2bc02ff..ab7252370ce 100644
--- a/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
+++ b/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
@@ -29,8 +29,10 @@ namespace OCA\UserStatus\Tests\Dashboard;
use OCA\UserStatus\Dashboard\UserStatusWidget;
use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Service\StatusService;
-use OCP\IInitialStateService;
+use OCP\AppFramework\Services\IInitialState;
+use OCP\IDateTimeFormatter;
use OCP\IL10N;
+use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserManager;
use OCP\IUserSession;
@@ -41,7 +43,13 @@ class UserStatusWidgetTest extends TestCase {
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
private $l10n;
- /** @var IInitialStateService|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IDateTimeFormatter|\PHPUnit\Framework\MockObject\MockObject */
+ private $dateTimeFormatter;
+
+ /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
+ private $urlGenerator;
+
+ /** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject */
private $initialState;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
@@ -60,12 +68,14 @@ class UserStatusWidgetTest extends TestCase {
parent::setUp();
$this->l10n = $this->createMock(IL10N::class);
- $this->initialState = $this->createMock(IInitialStateService::class);
+ $this->dateTimeFormatter = $this->createMock(IDateTimeFormatter::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
+ $this->initialState = $this->createMock(IInitialState::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->service = $this->createMock(StatusService::class);
- $this->widget = new UserStatusWidget($this->l10n, $this->initialState, $this->userManager, $this->userSession, $this->service);
+ $this->widget = new UserStatusWidget($this->l10n, $this->dateTimeFormatter, $this->urlGenerator, $this->initialState, $this->userManager, $this->userSession, $this->service);
}
public function testGetId(): void {
@@ -99,7 +109,7 @@ class UserStatusWidgetTest extends TestCase {
$this->initialState->expects($this->once())
->method('provideInitialState')
- ->with('user_status', 'dashboard_data', []);
+ ->with('dashboard_data', []);
$this->service->expects($this->never())
->method('findAllRecentStatusChanges');
@@ -195,7 +205,7 @@ class UserStatusWidgetTest extends TestCase {
$this->initialState->expects($this->once())
->method('provideInitialState')
- ->with('user_status', 'dashboard_data', $this->callback(function ($data): bool {
+ ->with('dashboard_data', $this->callback(function ($data): bool {
$this->assertEquals([
[
'userId' => 'user_1',