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