|
@@ 114-121 (lines=8) @@
|
| 111 |
|
$this->assertSame($result.$result, $processor->process($text.$text)); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
public function testReplacesLongerThanInputText() |
| 115 |
|
{ |
| 116 |
|
$handlers = new HandlerContainer(); |
| 117 |
|
$handlers->add('x', function() { return '<length>'; }); |
| 118 |
|
$processor = new Processor(new RegularParser(), $handlers); |
| 119 |
|
|
| 120 |
|
$this->assertSame('<length><length><length>', $processor->process('[x][x][x]')); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
public function testProcessorWithoutRecursion() |
| 124 |
|
{ |
|
@@ 288-295 (lines=8) @@
|
| 285 |
|
$processor->withAutoProcessContent(new \stdClass()); |
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
public function testDefaultHandler() |
| 289 |
|
{ |
| 290 |
|
$handlers = new HandlerContainer(); |
| 291 |
|
$handlers->setDefault(function (ShortcodeInterface $s) { return $s->getName(); }); |
| 292 |
|
$processor = new Processor(new RegexParser(), $handlers); |
| 293 |
|
|
| 294 |
|
$this->assertSame('namerandom', $processor->process('[name][other][/name][random]')); |
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
public function testStripOuter() |
| 298 |
|
{ |