Files
nextcloud-server-mirror/tests/lib/Repair/ClearFrontendCachesTest.php
Côme Chilliet 611180d728 chore: Replace $this->mocks[… by $this->getAutoMock(… in tests
This is clearer, safer and better typed.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-10-01 15:45:42 +02:00

39 lines
916 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Repair;
use OC\Repair\ClearFrontendCaches;
use OC\Template\JSCombiner;
use OCP\Migration\IOutput;
use PHPUnit\Framework\MockObject\MockObject;
class ClearFrontendCachesTest extends \Test\TestCase {
private IOutput&MockObject $outputMock;
protected ClearFrontendCaches $repair;
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->outputMock = $this->createMock(IOutput::class);
$this->repair = $this->createInstanceWithMocks(ClearFrontendCaches::class);
}
public function testRun(): void {
$this->getCacheAutoMock('imagePath')->expects($this->once())
->method('clear')
->with('');
$this->getAutoMock(JSCombiner::class)->expects($this->once())
->method('resetCache');
$this->repair->run($this->outputMock);
}
}