mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
perf(CheckSetupController): Remove BackupStaticProperties
It's so slow 25s per test cases Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
parent
6bb9ad60f2
commit
c02a231e7f
2 changed files with 0 additions and 24 deletions
|
|
@ -19,23 +19,17 @@ use OCP\AppFramework\Http\Attribute\OpenAPI;
|
|||
use OCP\AppFramework\Http\DataDisplayResponse;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\SetupCheck\ISetupCheckManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
|
||||
class CheckSetupController extends Controller {
|
||||
public function __construct(
|
||||
$appName,
|
||||
IRequest $request,
|
||||
private IConfig $config,
|
||||
private IURLGenerator $urlGenerator,
|
||||
private IL10N $l10n,
|
||||
private Checker $checker,
|
||||
private LoggerInterface $logger,
|
||||
private ISetupCheckManager $setupCheckManager,
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
|
|
|
|||
|
|
@ -14,13 +14,10 @@ use OCP\AppFramework\Http;
|
|||
use OCP\AppFramework\Http\DataDisplayResponse;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\IRequest;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\SetupCheck\ISetupCheckManager;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Test\TestCase;
|
||||
|
||||
/**
|
||||
|
|
@ -28,13 +25,9 @@ use Test\TestCase;
|
|||
*
|
||||
* @package Tests\Settings\Controller
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\BackupStaticProperties(true)]
|
||||
class CheckSetupControllerTest extends TestCase {
|
||||
private IRequest&MockObject $request;
|
||||
private IConfig&MockObject $config;
|
||||
private IURLGenerator&MockObject $urlGenerator;
|
||||
private IL10N&MockObject $l10n;
|
||||
private LoggerInterface&MockObject $logger;
|
||||
private Checker&MockObject $checker;
|
||||
private ISetupCheckManager&MockObject $setupCheckManager;
|
||||
private CheckSetupController $checkSetupController;
|
||||
|
|
@ -43,25 +36,14 @@ class CheckSetupControllerTest extends TestCase {
|
|||
parent::setUp();
|
||||
|
||||
$this->request = $this->createMock(IRequest::class);
|
||||
$this->config = $this->createMock(IConfig::class);
|
||||
$this->urlGenerator = $this->createMock(IURLGenerator::class);
|
||||
$this->l10n = $this->createMock(IL10N::class);
|
||||
$this->l10n->expects($this->any())
|
||||
->method('t')
|
||||
->willReturnCallback(function ($message, array $replace) {
|
||||
return vsprintf($message, $replace);
|
||||
});
|
||||
$this->checker = $this->createMock(Checker::class);
|
||||
$this->logger = $this->createMock(LoggerInterface::class);
|
||||
$this->setupCheckManager = $this->createMock(ISetupCheckManager::class);
|
||||
$this->checkSetupController = new CheckSetupController(
|
||||
'settings',
|
||||
$this->request,
|
||||
$this->config,
|
||||
$this->urlGenerator,
|
||||
$this->l10n,
|
||||
$this->checker,
|
||||
$this->logger,
|
||||
$this->setupCheckManager,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue