xref: /webtrees/tests/app/Elements/FamilySearchFamilyTreeIdTest.php (revision 5a8afed46297e8105e3e5a33ce37e6a8e88bc79d)
132a5d3c7SGreg Roach<?php
232a5d3c7SGreg Roach
332a5d3c7SGreg Roach/**
432a5d3c7SGreg Roach * webtrees: online genealogy
5d11be702SGreg Roach * Copyright (C) 2023 webtrees development team
632a5d3c7SGreg Roach * This program is free software: you can redistribute it and/or modify
732a5d3c7SGreg Roach * it under the terms of the GNU General Public License as published by
832a5d3c7SGreg Roach * the Free Software Foundation, either version 3 of the License, or
932a5d3c7SGreg Roach * (at your option) any later version.
1032a5d3c7SGreg Roach * This program is distributed in the hope that it will be useful,
1132a5d3c7SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
1232a5d3c7SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1332a5d3c7SGreg Roach * GNU General Public License for more details.
1432a5d3c7SGreg Roach * You should have received a copy of the GNU General Public License
1532a5d3c7SGreg Roach * along with this program. If not, see <https://www.gnu.org/licenses/>.
1632a5d3c7SGreg Roach */
1732a5d3c7SGreg Roach
1832a5d3c7SGreg Roachdeclare(strict_types=1);
1932a5d3c7SGreg Roach
2032a5d3c7SGreg Roachnamespace Fisharebest\Webtrees\Elements;
2132a5d3c7SGreg Roach
22*202c018bSGreg Roachuse PHPUnit\Framework\Attributes\CoversClass;
23*202c018bSGreg Roach
24*202c018bSGreg Roach#[CoversClass(AbstractElement::class)]
25*202c018bSGreg Roach#[CoversClass(AbstractExternalLink::class)]
26*202c018bSGreg Roach#[CoversClass(FamilySearchFamilyTreeId::class)]
27b66f5d1aSGreg Roachclass FamilySearchFamilyTreeIdTest extends AbstractElementTestCase
2832a5d3c7SGreg Roach{
2932a5d3c7SGreg Roach    /**
3032a5d3c7SGreg Roach     * Standard tests for all elements.
3132a5d3c7SGreg Roach     */
3232a5d3c7SGreg Roach    public static function setupBeforeClass(): void
3332a5d3c7SGreg Roach    {
3432a5d3c7SGreg Roach        parent::setUpBeforeClass();
3532a5d3c7SGreg Roach
3632a5d3c7SGreg Roach        self::$element = new AncestralFileNumber('label');
3732a5d3c7SGreg Roach    }
3832a5d3c7SGreg Roach
3932a5d3c7SGreg Roach    public function testCanonical(): void
4032a5d3c7SGreg Roach    {
416e60786aSGreg Roach        self::assertSame('FOO BAR BAZ', self::$element->canonical('Foo  bAr  baZ'));
4232a5d3c7SGreg Roach        self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t "));
4332a5d3c7SGreg Roach        self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r"));
4432a5d3c7SGreg Roach    }
4532a5d3c7SGreg Roach}
46