Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix missing imports
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jun 8, 2022
commit 7cc9187028991e98fc8eb6733b521a72342c4a53
10 changes: 4 additions & 6 deletions apps/updatenotification/tests/ResetTokenBackgroundJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ public function testRunWithNotExpiredToken() {

public function testRunWithExpiredToken() {
$this->timeFactory
->expects($this->at(0))
->method('getTime')
->willReturn(1455131633);
$this->timeFactory
->expects($this->at(1))
->method('getTime')
->willReturn(1455045234);
->willReturnOnConsecutiveCalls(
1455131633,
1455045234
);
$this->config
->expects($this->once())
->method('getAppValue')
Expand Down
38 changes: 22 additions & 16 deletions apps/updatenotification/tests/Settings/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,26 @@
*/
namespace OCA\UpdateNotification\Tests\Settings;

use OC\User\Backend;
use OCA\UpdateNotification\Settings\Admin;
use OCA\UpdateNotification\UpdateChecker;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IDateTimeFormatter;
use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\L10N\ILanguageIterator;
use OCP\Support\Subscription\IRegistry;
use OCP\User\Backend\ICountUsersBackend;
use OCP\UserInterface;
use OCP\Util;
use Test\TestCase;
use OCP\IUserManager;
use Psr\Log\LoggerInterface;
use Test\TestCase;

interface UserInterfaceAwareICountUsersBackend extends UserInterface, ICountUsersBackend {
}

class AdminTest extends TestCase {
/** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
Expand Down Expand Up @@ -77,21 +83,21 @@ protected function setUp(): void {
$this->logger = $this->createMock(LoggerInterface::class);

$this->admin = new Admin(
$this->config,
$this->updateChecker,
$this->groupManager,
$this->dateTimeFormatter,
$this->l10nFactory,
$this->config,
$this->updateChecker,
$this->groupManager,
$this->dateTimeFormatter,
$this->l10nFactory,
$this->subscriptionRegistry,
$this->userManager,
$this->logger
);
}

public function testGetFormWithUpdate() {
$backend1 = $this->createMock(UserInterface::class);
$backend2 = $this->createMock(UserInterface::class);
$backend3 = $this->createMock(UserInterface::class);
$backend1 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend2 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend3 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
Expand Down Expand Up @@ -213,9 +219,9 @@ public function testGetFormWithUpdate() {
}

public function testGetFormWithUpdateAndChangedUpdateServer() {
$backend1 = $this->createMock(UserInterface::class);
$backend2 = $this->createMock(UserInterface::class);
$backend3 = $this->createMock(UserInterface::class);
$backend1 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend2 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend3 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
Expand Down Expand Up @@ -337,9 +343,9 @@ public function testGetFormWithUpdateAndChangedUpdateServer() {
}

public function testGetFormWithUpdateAndCustomersUpdateServer() {
$backend1 = $this->createMock(UserInterface::class);
$backend2 = $this->createMock(UserInterface::class);
$backend3 = $this->createMock(UserInterface::class);
$backend1 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend2 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend3 = $this->createMock(UserInterfaceAwareICountUsersBackend::class);
$backend1
->expects($this->once())
->method('implementsActions')
Expand Down