xref: /webtrees/tests/app/Factories/RouteFactoryTest.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
16777192fSGreg Roach<?php
26777192fSGreg Roach
36777192fSGreg Roach/**
46777192fSGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
66777192fSGreg Roach * This program is free software: you can redistribute it and/or modify
76777192fSGreg Roach * it under the terms of the GNU General Public License as published by
86777192fSGreg Roach * the Free Software Foundation, either version 3 of the License, or
96777192fSGreg Roach * (at your option) any later version.
106777192fSGreg Roach * This program is distributed in the hope that it will be useful,
116777192fSGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
126777192fSGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136777192fSGreg Roach * GNU General Public License for more details.
146777192fSGreg Roach * You should have received a copy of the GNU General Public License
156777192fSGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
166777192fSGreg Roach */
176777192fSGreg Roach
186777192fSGreg Roachdeclare(strict_types=1);
196777192fSGreg Roach
206777192fSGreg Roachnamespace Fisharebest\Webtrees\Factories;
216777192fSGreg Roach
226777192fSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\HomePage;
236777192fSGreg Roachuse Fisharebest\Webtrees\TestCase;
24*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
256777192fSGreg Roach
26*202c018bSGreg Roach#[CoversClass(RouteFactory::class)]
276777192fSGreg Roachclass RouteFactoryTest extends TestCase
286777192fSGreg Roach{
296777192fSGreg Roach    /**
306777192fSGreg Roach     */
316777192fSGreg Roach    public function testEmptyQueryParameterInURL(): void
326777192fSGreg Roach    {
336777192fSGreg Roach        $route_factory = new RouteFactory();
346777192fSGreg Roach
356777192fSGreg Roach        $url = $route_factory->route(HomePage::class, ['foo' => null, 'bar' => '']);
366777192fSGreg Roach
37e1ade55dSGreg Roach        static::assertStringNotContainsString('foo=', $url);
38e1ade55dSGreg Roach        static::assertStringContainsString('bar=', $url);
396777192fSGreg Roach    }
406777192fSGreg Roach}
41