Enable automatic translations of times "before" a given date
This commit is contained in:
@ -575,4 +575,73 @@ 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 testCanTranslateBeforeSingleYear():void {
|
||||
|
||||
$timeInfo = [
|
||||
"zeit_name" => "Vor 1919",
|
||||
"zeit_beginn" => "?",
|
||||
"zeit_ende" => "1918",
|
||||
"zeit_zaehlzeit_jahr" => "1919",
|
||||
"zeit_zaehlzeit_monat" => "00",
|
||||
"zeit_zaehlzeit_tag" => "00",
|
||||
];
|
||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||
self::assertEquals($output["de"], "Vor 1919");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCanTranslateBeforeSingleMonth():void {
|
||||
|
||||
$timeInfo = [
|
||||
"zeit_name" => "Vor Mai 1920",
|
||||
"zeit_beginn" => "?",
|
||||
"zeit_ende" => "1920",
|
||||
"zeit_zaehlzeit_jahr" => "1920",
|
||||
"zeit_zaehlzeit_monat" => "05",
|
||||
"zeit_zaehlzeit_tag" => "00",
|
||||
];
|
||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||
self::assertEquals($output["de"], "Vor Mai 1920");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCanTranslateBeforeSingleDay():void {
|
||||
|
||||
$timeInfo = [
|
||||
"zeit_name" => "Vor 01.12.1919",
|
||||
"zeit_beginn" => "?",
|
||||
"zeit_ende" => "1919",
|
||||
"zeit_zaehlzeit_jahr" => "1919",
|
||||
"zeit_zaehlzeit_monat" => "12",
|
||||
"zeit_zaehlzeit_tag" => "01",
|
||||
];
|
||||
$output = NodaTimeAutotranslater::getTranslations($timeInfo);
|
||||
self::assertEquals($output["de"], "Vor 01.12.1919");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user