xref: /webtrees/tests/app/Factories/RouteFactoryTest.php (revision d11be7027e34e3121be11cc025421873364403f9)
16777192fSGreg Roach<?php
26777192fSGreg Roach
36777192fSGreg Roach/**
46777192fSGreg Roach * webtrees: online genealogy
5*d11be702SGreg 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;
246777192fSGreg Roach
256777192fSGreg Roach/**
266777192fSGreg Roach * Test harness for the class RouteFactory
276777192fSGreg Roach *
286777192fSGreg Roach * @covers \Fisharebest\Webtrees\Factories\RouteFactory
296777192fSGreg Roach */
306777192fSGreg Roachclass RouteFactoryTest extends TestCase
316777192fSGreg Roach{
326777192fSGreg Roach    /**
336777192fSGreg Roach     */
346777192fSGreg Roach    public function testEmptyQueryParameterInURL(): void
356777192fSGreg Roach    {
366777192fSGreg Roach        $route_factory = new RouteFactory();
376777192fSGreg Roach
386777192fSGreg Roach        $url = $route_factory->route(HomePage::class, ['foo' => null, 'bar' => '']);
396777192fSGreg Roach
40e1ade55dSGreg Roach        static::assertStringNotContainsString('foo=', $url);
41e1ade55dSGreg Roach        static::assertStringContainsString('bar=', $url);
426777192fSGreg Roach    }
436777192fSGreg Roach}
44