mirror of
https://github.com/nextcloud/server.git
synced 2026-11-12 04:32:03 +01:00
This is clearer, safer and better typed. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
39 lines
916 B
PHP
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);
|
|
}
|
|
}
|