38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace dokuwiki\plugin\luxtools\test;
|
|
|
|
use dokuwiki\plugin\luxtools\ChronologicalDayTemplate;
|
|
use DokuWikiTest;
|
|
|
|
require_once(__DIR__ . '/../autoload.php');
|
|
|
|
/**
|
|
* Tests for German day template generation.
|
|
*
|
|
* @group plugin_luxtools
|
|
* @group plugins
|
|
*/
|
|
class ChronologicalDayTemplateTest extends DokuWikiTest
|
|
{
|
|
public function testBuildForDayIdGermanHeading(): void
|
|
{
|
|
$tpl = ChronologicalDayTemplate::buildForDayId('chronological:2026:02:13');
|
|
if (!is_string($tpl) || $tpl === '') {
|
|
throw new \Exception('Expected non-empty day template');
|
|
}
|
|
|
|
if (strpos($tpl, '====== Freitag, 13. Februar 2026 ======') === false) {
|
|
throw new \Exception('Expected German formatted heading not found');
|
|
}
|
|
}
|
|
|
|
public function testBuildForDayIdRejectsInvalid(): void
|
|
{
|
|
$tpl = ChronologicalDayTemplate::buildForDayId('chronological:2026:02');
|
|
if ($tpl !== null) {
|
|
throw new \Exception('Expected null for non-day ID');
|
|
}
|
|
}
|
|
}
|