|
@@ 49-57 (lines=9) @@
|
| 46 |
|
return $handlers; |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testReplaceWithoutContentOffset() |
| 50 |
|
{ |
| 51 |
|
$text = ' [x value=" [name]yyy[/name] "] [name]yyy[/name] [/x] '; |
| 52 |
|
$result = ' [x value=" [name]yyy[/name] "] name [/x] '; |
| 53 |
|
|
| 54 |
|
$processor = new Processor(new RegexParser(), $this->getHandlers()); |
| 55 |
|
|
| 56 |
|
$this->assertSame($result, $processor->process($text)); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
/** |
| 60 |
|
* @param string $text |
|
@@ 114-120 (lines=7) @@
|
| 111 |
|
$this->assertSame($result.$result, $processor->process($text.$text)); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
public function testProcessorWithoutRecursion() |
| 115 |
|
{ |
| 116 |
|
$processor = new Processor(new RegexParser(), $this->getHandlers()); |
| 117 |
|
$text = 'x [content]a-[name][/name]-b[/content] y'; |
| 118 |
|
|
| 119 |
|
$this->assertSame('x a-[name][/name]-b y', $processor->withRecursionDepth(0)->process($text)); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
public function testProcessContentIfHasChildHandlerButNotParent() |
| 123 |
|
{ |
|
@@ 134-140 (lines=7) @@
|
| 131 |
|
$this->assertSame('x [invalid ] [valid /] [/invalid] y', $processor->withAutoProcessContent(false)->process($text)); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
public function testProcessorWithoutContentAutoProcessing() |
| 135 |
|
{ |
| 136 |
|
$processor = new Processor(new RegexParser(), $this->getHandlers()); |
| 137 |
|
$text = 'x [content]a-[name][/name]-b[/content] y'; |
| 138 |
|
|
| 139 |
|
$this->assertSame('x a-[name][/name]-b y', $processor->withAutoProcessContent(false)->process($text)); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
public function testProcessorShortcodePositions() |
| 143 |
|
{ |