Skip to content

Commit

Permalink
Fix various deprecation warnings in tests on PHP 8.3
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Aug 14, 2023
1 parent 8857599 commit f57c12b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function testIndexWithRegularBrowser() {
->willReturnMap([
[$this->user->getUID(), 'files', 'file_sorting', 'name', 'name'],
[$this->user->getUID(), 'files', 'file_sorting_direction', 'asc', 'asc'],
[$this->user->getUID(), 'files', 'files_sorting_configs', '{}', '{}'],
[$this->user->getUID(), 'files', 'show_hidden', false, false],
[$this->user->getUID(), 'files', 'crop_image_previews', true, true],
[$this->user->getUID(), 'files', 'show_grid', true],
Expand Down
5 changes: 5 additions & 0 deletions tests/lib/App/AppManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ public function testGetDefaultAppForUser($defaultApps, $expectedApp) {
->with('defaultapp', $this->anything())
->willReturn($defaultApps);

$this->config->expects($this->once())
->method('getUserValue')
->with('user1', 'core', 'defaultapp')
->willReturn('');

$this->assertEquals($expectedApp, $this->manager->getDefaultAppForUser());
}
}
3 changes: 3 additions & 0 deletions tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\Security\ICrypto;
use OCP\Security\IHasher;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
Expand All @@ -47,6 +48,8 @@ class PublicKeyTokenProviderTest extends TestCase {
private $tokenProvider;
/** @var PublicKeyTokenMapper|\PHPUnit\Framework\MockObject\MockObject */
private $mapper;
/** @var IHasher|\PHPUnit\Framework\MockObject\MockObject */
private $hasher;
/** @var ICrypto */
private $crypto;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class LocalTimeProviderTest extends TestCase {
private $actionFactory;
/** @var IL10N|MockObject */
private $l;
/** @var IL10NFactory|MockObject */
private $l10nFactory;
/** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var IUserManager|MockObject */
Expand Down
1 change: 1 addition & 0 deletions tests/lib/Http/Client/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ClientTest extends \Test\TestCase {
private $config;
/** @var IRemoteHostValidator|MockObject */
private IRemoteHostValidator $remoteHostValidator;
private LoggerInterface $logger;
/** @var array */
private $defaultRequestOptions;

Expand Down
9 changes: 9 additions & 0 deletions tests/lib/TextProcessing/TextProcessingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use OC\TextProcessing\TaskBackgroundJob;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\Common\Exception\NotFoundException;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
Expand Down Expand Up @@ -90,6 +91,14 @@ public function getTaskType(): string {
class TextProcessingTest extends \Test\TestCase {
private IManager $manager;
private Coordinator $coordinator;
private array $providers;
private IServerContainer $serverContainer;
private IEventDispatcher $eventDispatcher;
private RegistrationContext $registrationContext;
private \DateTimeImmutable $currentTime;
private TaskMapper $taskMapper;
private array $tasksDb;
private IJobList $jobList;

protected function setUp(): void {
parent::setUp();
Expand Down

0 comments on commit f57c12b

Please sign in to comment.