xref: /webtrees/tests/app/Http/RequestHandlers/SiteLogsPageTest.php (revision 62ff2f188c699b1144fb2ca2d6da1358d5e1a745)
16c21f8beSGreg Roach<?php
26c21f8beSGreg Roach
36c21f8beSGreg Roach/**
46c21f8beSGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
66c21f8beSGreg Roach * This program is free software: you can redistribute it and/or modify
76c21f8beSGreg Roach * it under the terms of the GNU General Public License as published by
86c21f8beSGreg Roach * the Free Software Foundation, either version 3 of the License, or
96c21f8beSGreg Roach * (at your option) any later version.
106c21f8beSGreg Roach * This program is distributed in the hope that it will be useful,
116c21f8beSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
126c21f8beSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136c21f8beSGreg Roach * GNU General Public License for more details.
146c21f8beSGreg Roach * You should have received a copy of the GNU General Public License
156c21f8beSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
166c21f8beSGreg Roach */
176c21f8beSGreg Roach
186c21f8beSGreg Roachdeclare(strict_types=1);
196c21f8beSGreg Roach
206c21f8beSGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers;
216c21f8beSGreg Roach
226c21f8beSGreg Roachuse Fig\Http\Message\StatusCodeInterface;
236c21f8beSGreg Roachuse Fisharebest\Webtrees\Services\TreeService;
246c21f8beSGreg Roachuse Fisharebest\Webtrees\Services\UserService;
256c21f8beSGreg Roachuse Fisharebest\Webtrees\TestCase;
266c21f8beSGreg Roachuse Illuminate\Support\Collection;
27202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
286c21f8beSGreg Roach
29202c018bSGreg Roach#[CoversClass(SiteLogsPage::class)]
306c21f8beSGreg Roachclass SiteLogsPageTest extends TestCase
316c21f8beSGreg Roach{
32a26ec5edSGreg Roach    protected static bool $uses_database = true;
33a26ec5edSGreg Roach
346c21f8beSGreg Roach    public function testResponse(): void
356c21f8beSGreg Roach    {
366c21f8beSGreg Roach        $request = self::createRequest();
376c21f8beSGreg Roach
38*62ff2f18SGreg Roach        $tree_service = $this->createMock(TreeService::class);
396c21f8beSGreg Roach        $tree_service->method('all')->willReturn(new Collection());
406c21f8beSGreg Roach
41*62ff2f18SGreg Roach        $user_service = $this->createMock(UserService::class);
426c21f8beSGreg Roach        $user_service->method('all')->willReturn(new Collection());
436c21f8beSGreg Roach
446c21f8beSGreg Roach        $handler  = new SiteLogsPage($tree_service, $user_service);
456c21f8beSGreg Roach        $response = $handler->handle($request);
466c21f8beSGreg Roach
47e1ade55dSGreg Roach        static::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
486c21f8beSGreg Roach    }
496c21f8beSGreg Roach}
50