xref: /webtrees/tests/app/Http/RequestHandlers/SiteLogsPageTest.php (revision d11be7027e34e3121be11cc025421873364403f9)
16c21f8beSGreg Roach<?php
26c21f8beSGreg Roach
36c21f8beSGreg Roach/**
46c21f8beSGreg Roach * webtrees: online genealogy
5*d11be702SGreg 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;
276c21f8beSGreg Roach
286c21f8beSGreg Roach/**
296c21f8beSGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\SiteLogsPage
306c21f8beSGreg Roach */
316c21f8beSGreg Roachclass SiteLogsPageTest extends TestCase
326c21f8beSGreg Roach{
336c21f8beSGreg Roach    /**
346c21f8beSGreg Roach     * @return void
356c21f8beSGreg Roach     */
366c21f8beSGreg Roach    public function testResponse(): void
376c21f8beSGreg Roach    {
386c21f8beSGreg Roach        $request = self::createRequest();
396c21f8beSGreg Roach
406c21f8beSGreg Roach        $tree_service = $this->createStub(TreeService::class);
416c21f8beSGreg Roach        $tree_service->method('all')->willReturn(new Collection());
426c21f8beSGreg Roach
436c21f8beSGreg Roach        $user_service = $this->createStub(UserService::class);
446c21f8beSGreg Roach        $user_service->method('all')->willReturn(new Collection());
456c21f8beSGreg Roach
466c21f8beSGreg Roach        $handler  = new SiteLogsPage($tree_service, $user_service);
476c21f8beSGreg Roach        $response = $handler->handle($request);
486c21f8beSGreg Roach
49e1ade55dSGreg Roach        static::assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
506c21f8beSGreg Roach    }
516c21f8beSGreg Roach}
52