Files
nextcloud-server-mirror/tests/lib/AppFramework/Bootstrap/BootContextTest.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
894 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace lib\AppFramework\Bootstrap;
use OC\AppFramework\Bootstrap\BootContext;
use OC\Server;
use Psr\Container\ContainerInterface;
use Test\TestCase;
class BootContextTest extends TestCase {
private BootContext $context;
#[\Override]
protected function setUp(): void {
parent::setUp();
$this->context = $this->createInstanceWithMocks(BootContext::class);
}
public function testGetAppContainer(): void {
$container = $this->context->getAppContainer();
$this->assertSame($this->getAutoMock(ContainerInterface::class), $container);
}
public function testGetServerContainer(): void {
$container = $this->context->getServerContainer();
$this->assertSame($this->getAutoMock(Server::class), $container);
}
}