MDNodaHelpers/tests/NodaConsolidatedNamesForPersinstTest.php

51 lines
3.5 KiB
PHP

<?PHP
/**
* Tests for setting uniform actor names.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
use PHPUnit\Framework\TestCase;
/**
* Tests for setting uniform actor names.
*
* @covers \NodaConsolidatedNamesForPersinst
*/
final class NodaConsolidatedNamesForPersinstTest extends TestCase {
/**
* Test that cleanup function returns expected values.
*
* @small
*
* @return void
*/
public function testCleaningNamesWithCanonicalForms():void {
self::assertEquals("Friedrich Barbarossa (Kaiser)", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Friedrich Barbarossa <Kaiser>"));
self::assertEquals("Friedrich Barbarossa (Kaiser)", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Friedrich Barbarossa <Kaiser>, "));
self::assertEquals("Friedrich Barbarossa (Kaiser)", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Friedrich Barbarossa <Kaiser>, ||"));
self::assertEquals("Friedrich Barbarossa", NodaConsolidatedNamesForPersinst::consolidate_name("de", "(Friedrich Barbarossa)"));
self::assertEquals("Friedrich Barbarossa", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Friedrich Barbarossa."));
self::assertEquals("Fr d.Ä", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Fr d.Ä."));
self::assertEquals("Raffaelli, C. d. J", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Raffaelli, C. d. J."));
self::assertEquals("Friedrich Barbarossa d.Ä", NodaConsolidatedNamesForPersinst::consolidate_name("en", "Friedrich Barbarossa d.Ä."));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name("de", "Friedrich Barbarossa d.Ä."));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa d. Ä."));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa (d.Ä.)"));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa (d. Ä.)"));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa [d.Ä.]"));
self::assertEquals("Friedrich Barbarossa (der Ältere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa [d. Ä.]"));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa d.J."));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa d. J."));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa (d.J.)"));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa (d. J.)"));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa [d.J.]"));
self::assertEquals("Friedrich Barbarossa (der Jüngere)", NodaConsolidatedNamesForPersinst::consolidate_name('de', "Friedrich Barbarossa [d. J.]"));
}
}