Skip to content

Commit

Permalink
Fix sharing settings unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Nov 21, 2023
1 parent f74084c commit 2c195d7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion apps/settings/tests/Settings/Admin/SharingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
use OCA\Settings\Settings\Admin\Sharing;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Constants;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Share\IManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
Expand All @@ -52,20 +54,35 @@ class SharingTest extends TestCase {
private $shareManager;
/** @var IAppManager|MockObject */
private $appManager;
/** @var IURLGenerator|MockObject */
private $urlGenerator;
/** @var IInitialState|MockObject */
private $initialState;

protected function setUp(): void {
parent::setUp();
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
$this->l10n = $this->getMockBuilder(IL10N::class)->getMock();

/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
$this->shareManager = $this->getMockBuilder(IManager::class)->getMock();
/** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */
$this->appManager = $this->getMockBuilder(IAppManager::class)->getMock();
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
$this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
/** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject */
$this->initialState = $this->getMockBuilder(IInitialState::class)->getMock();

$this->admin = new Sharing(
$this->config,
$this->l10n,
$this->shareManager,
$this->appManager
$this->appManager,
$this->urlGenerator,
$this->initialState,
"",
);
}

Expand Down

0 comments on commit 2c195d7

Please sign in to comment.