public function testStripOuter()
{
$handlers = new HandlerContainer();
$handlers->add('q', function (ShortcodeInterface $s) {
return $s->getContent();
});
$handlers->add('p', function (ProcessedShortcode $s) use(&$handlers) {
$parser = new RegexParser();
$processor = new Processor($parser, $handlers);
$shortcodes = $parser->parse($s->getTextContent());
return array_reduce($shortcodes, function ($result, ParsedShortcodeInterface $s) use($processor) {
return $result . $processor->process($s->getText());
}, '');
});
$processor = new Processor(new RegexParser(), $handlers);
$this->assertSame('x ab y', $processor->process('x [p] [q]a[/q] [q]b[/q] [/p] y'));
$this->assertSame('x ab c y', $processor->process('x [p] [q]a[/q] [q]b [q]c[/q][/q] [/p] y'));
}