Add the Chronological
This commit is contained in:
37
_test/ChronologicalDayTemplateTest.php
Normal file
37
_test/ChronologicalDayTemplateTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user