10c0910bfSGreg Roach<?php 20c0910bfSGreg Roach 30c0910bfSGreg Roach/** 40c0910bfSGreg Roach * webtrees: online genealogy 589f7189bSGreg Roach * Copyright (C) 2021 webtrees development team 60c0910bfSGreg Roach * This program is free software: you can redistribute it and/or modify 70c0910bfSGreg Roach * it under the terms of the GNU General Public License as published by 80c0910bfSGreg Roach * the Free Software Foundation, either version 3 of the License, or 90c0910bfSGreg Roach * (at your option) any later version. 100c0910bfSGreg Roach * This program is distributed in the hope that it will be useful, 110c0910bfSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 120c0910bfSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 130c0910bfSGreg Roach * GNU General Public License for more details. 140c0910bfSGreg Roach * You should have received a copy of the GNU General Public License 1589f7189bSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>. 160c0910bfSGreg Roach */ 17fcfa147eSGreg Roach 180c0910bfSGreg Roachdeclare(strict_types=1); 190c0910bfSGreg Roach 20*110d87e5SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers; 210c0910bfSGreg Roach 220c0910bfSGreg Roachuse Fig\Http\Message\StatusCodeInterface; 236fd01894SGreg Roachuse Fisharebest\Webtrees\Services\AdminService; 242c685d76SGreg Roachuse Fisharebest\Webtrees\Services\GedcomImportService; 250c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\HousekeepingService; 260c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\ModuleService; 270c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\ServerCheckService; 280c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\TimeoutService; 290c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\TreeService; 300c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\UpgradeService; 310c0910bfSGreg Roachuse Fisharebest\Webtrees\Services\UserService; 320c0910bfSGreg Roachuse Fisharebest\Webtrees\TestCase; 330c0910bfSGreg Roach 340c0910bfSGreg Roach/** 350c0910bfSGreg Roach * Test the control panel 360c0910bfSGreg Roach * 370c0910bfSGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel 380c0910bfSGreg Roach */ 390c0910bfSGreg Roachclass ControlPanelControllerTest extends TestCase 400c0910bfSGreg Roach{ 41cd94ca66SGreg Roach protected static bool $uses_database = true; 420c0910bfSGreg Roach 430c0910bfSGreg Roach /** 440c0910bfSGreg Roach * @return void 450c0910bfSGreg Roach */ 460c0910bfSGreg Roach public function testControlPanel(): void 470c0910bfSGreg Roach { 486fd01894SGreg Roach $admin_service = new AdminService(); 490c0910bfSGreg Roach $module_service = new ModuleService(); 500c0910bfSGreg Roach $housekeeping_service = new HousekeepingService(); 510c0910bfSGreg Roach $server_check_service = new ServerCheckService(); 520c0910bfSGreg Roach $timeout_service = new TimeoutService(); 532c685d76SGreg Roach $gedcom_import_service = new GedcomImportService(); 542c685d76SGreg Roach $tree_service = new TreeService($gedcom_import_service); 550c0910bfSGreg Roach $upgrade_service = new UpgradeService($timeout_service); 560c0910bfSGreg Roach $user_service = new UserService(); 576fd01894SGreg Roach $handler = new ControlPanel($admin_service, $housekeeping_service, $module_service, $server_check_service, $tree_service, $upgrade_service, $user_service); 580c0910bfSGreg Roach $request = self::createRequest(); 590c0910bfSGreg Roach $response = $handler->handle($request); 600c0910bfSGreg Roach 615e933c21SGreg Roach self::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode()); 620c0910bfSGreg Roach } 630c0910bfSGreg Roach} 64