Disallow translating as decade before 1000 CE
This commit is contained in:
@ -101,6 +101,28 @@ final class NodaTimeAutotranslaterTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCanTranslateDecade():void {
|
||||
|
||||
$timeInfo = [
|
||||
"zeit_beginn" => "1920",
|
||||
"zeit_ende" => "1929",
|
||||
"zeit_zaehlzeit_jahr" => "1925",
|
||||
"zeit_zaehlzeit_monat" => "00",
|
||||
"zeit_zaehlzeit_tag" => "00",
|
||||
];
|
||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||
self::assertEquals($output["de"], "1920er Jahre");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
@ -123,6 +145,28 @@ final class NodaTimeAutotranslaterTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testTranslateDecadeBeforeCommonEraAsTimespan():void {
|
||||
|
||||
$timeInfo = [
|
||||
"zeit_beginn" => "-10",
|
||||
"zeit_ende" => "-1",
|
||||
"zeit_zaehlzeit_jahr" => "0005",
|
||||
"zeit_zaehlzeit_monat" => "00",
|
||||
"zeit_zaehlzeit_tag" => "00",
|
||||
];
|
||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||
self::assertEquals($output["de"], "10-1 v. Chr.");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
|
Reference in New Issue
Block a user