. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(AbstractElement::class)] #[CoversClass(MaidenheadLocator::class)] class MaidenheadLocatorTest extends AbstractElementTestCase { /** * Standard tests for all elements. */ public static function setupBeforeClass(): void { parent::setUpBeforeClass(); self::$element = new MaidenheadLocator('label'); } public function testCanonical(): void { self::assertSame('AB', self::$element->canonical('ab')); self::assertSame('AB', self::$element->canonical('AB')); self::assertSame('AB12', self::$element->canonical('ab12')); self::assertSame('AB12', self::$element->canonical('AB12')); self::assertSame('AB12cd', self::$element->canonical('ab12cd')); self::assertSame('AB12cd', self::$element->canonical('AB12CD')); self::assertSame('AB12cd34', self::$element->canonical('ab12cd34')); self::assertSame('AB12cd34', self::$element->canonical('AB12CD34')); } }