Use [[PLACEHOLDER]] instead of %%PLACEHOLDER%% for label placeholders.

This commit is contained in:
Jan Böhmer 2020-04-25 18:19:15 +02:00
parent cb2d0d9845
commit 3163a7ba09
14 changed files with 80 additions and 78 deletions

View file

@ -55,28 +55,28 @@ class LabelTextReplacerTest extends WebTestCase
public function handlePlaceholderDataProvider(): array
{
return [
['Part 1', '%%NAME%%'],
['P Description', '%%DESCRIPTION%%'],
['%%UNKNOWN%%', '%%UNKNOWN%%'],
['%%INVALID', '%%INVALID'],
['%%', '%%'],
['Part 1', '[[NAME]]'],
['P Description', '[[DESCRIPTION]]'],
['[[UNKNOWN]]', '[[UNKNOWN]]', '[[UNKNOWN]]'],
['[[INVALID', '[[INVALID'],
['[[', '[['],
['NAME', 'NAME'],
['%%NAME', '%%NAME'],
['Test %%NAME%%', 'Test %%NAME%%'],
['[[NAME', '[[NAME'],
['Test [[NAME]]', 'Test [[NAME]]', 'Test [[NAME]]'],
];
}
public function replaceDataProvider(): array
{
return [
['Part 1', '%%NAME%%'],
['TestPart 1', 'Test%%NAME%%'],
["P Description\nPart 1", "%%DESCRIPTION_T%%\n%%NAME%%"],
['Part 1 Part 1', '%%NAME%% %%NAME%%'],
['%%UNKNOWN%% Test', '%%UNKNOWN%% Test'],
["%%NAME\n%% %%NAME %%", "%%NAME\n%% %%NAME %%"],
['%%%%', '%%%%'],
['TEST%% %%TEST', 'TEST%% %%TEST']
['Part 1', '[[NAME]]'],
['TestPart 1', 'Test[[NAME]]'],
["P Description\nPart 1", "[[DESCRIPTION_T]]\n[[NAME]]"],
['Part 1 Part 1', '[[NAME]] [[NAME]]'],
['[[UNKNOWN]] Test', '[[UNKNOWN]] Test'],
["[[NAME\n]] [[NAME ]]", "[[NAME\n]] [[NAME ]]"],
['[[]]', '[[]]'],
['TEST[[ ]]TEST', 'TEST[[ ]]TEST']
];
}
@ -107,6 +107,6 @@ class LabelTextReplacerTest extends WebTestCase
$part->setName('Part');
$part_lot->setPart($part);
$this->assertSame('Part', $this->service->handlePlaceholder('%%NAME%%', $part_lot));
$this->assertSame('Part', $this->service->handlePlaceholder('[[NAME]]', $part_lot));
}
}