. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\Controllers\Admin; use Fig\Http\Message\StatusCodeInterface; use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel; use Fisharebest\Webtrees\Services\AdminService; use Fisharebest\Webtrees\Services\GedcomImportService; use Fisharebest\Webtrees\Services\HousekeepingService; use Fisharebest\Webtrees\Services\ModuleService; use Fisharebest\Webtrees\Services\ServerCheckService; use Fisharebest\Webtrees\Services\TimeoutService; use Fisharebest\Webtrees\Services\TreeService; use Fisharebest\Webtrees\Services\UpgradeService; use Fisharebest\Webtrees\Services\UserService; use Fisharebest\Webtrees\TestCase; /** * Test the control panel * * @covers \Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel */ class ControlPanelControllerTest extends TestCase { protected static bool $uses_database = true; /** * @return void */ public function testControlPanel(): void { $admin_service = new AdminService(); $module_service = new ModuleService(); $housekeeping_service = new HousekeepingService(); $server_check_service = new ServerCheckService(); $timeout_service = new TimeoutService(); $gedcom_import_service = new GedcomImportService(); $tree_service = new TreeService($gedcom_import_service); $upgrade_service = new UpgradeService($timeout_service); $user_service = new UserService(); $handler = new ControlPanel($admin_service, $housekeeping_service, $module_service, $server_check_service, $tree_service, $upgrade_service, $user_service); $request = self::createRequest(); $response = $handler->handle($request); self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); } }