. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; /** * Test harness for the class MaidenheadLocator * * @covers \Fisharebest\Webtrees\Elements\AbstractElement * @covers \Fisharebest\Webtrees\Elements\MaidenheadLocator */ class MaidenheadLocatorTest extends AbstractElementTest { /** * Standard tests for all elements. */ public static function setupBeforeClass(): void { parent::setUpBeforeClass(); self::$element = new MaidenheadLocator('label'); } /** * @return void */ 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")); } }