Scratchpads V1

This commit is contained in:
2026-01-09 09:26:39 +01:00
parent 16a07701ee
commit 0948f50d76
15 changed files with 718 additions and 27 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace dokuwiki\plugin\luxtools\test;
use dokuwiki\plugin\luxtools\ScratchpadMap;
use DokuWikiTest;
/**
* ScratchpadMap tests for the luxtools plugin
*
* @group plugin_luxtools
* @group plugins
*/
class ScratchpadMapTest extends DokuWikiTest
{
public function testResolveAndParsing()
{
$map = new ScratchpadMap(
<<<EOT
/var/scratchpads/startpad.txt
A> start
C:\\pads\\notes.md
A> notes
W> ignored
\\\\server\\share\\pads\\team.txt
A> team
EOT
);
$this->assertEquals('/var/scratchpads/startpad.txt', $map->resolve('start'));
$this->assertEquals('C:/pads/notes.md', $map->resolve('notes'));
$this->assertEquals('\\\\server/share/pads/team.txt', $map->resolve('team'));
}
public function testUnknownAliasThrows()
{
$map = new ScratchpadMap("/tmp/pad.txt\nA> pad\n");
$this->expectExceptionMessageMatches('/Unknown scratchpad alias/');
$map->resolve('nope');
}
}