@@ -260,6 +260,30 @@ public function provideShortcodes()
260260 return $ result ;
261261 }
262262
263+ public function testValueModeAggressive ()
264+ {
265+ $ parser = new RegularParser (new CommonSyntax ());
266+ $ parser ->valueMode = RegularParser::VALUE_AGGRESSIVE ;
267+ $ parsed = $ parser ->parse ('[x=/[/] [y a=/"//] [z=http://url/] [a=http://url ] ' );
268+ $ tested = array (
269+ new ParsedShortcode (new Shortcode ('x ' , array (), null , '/[/ ' ), '[x=/[/] ' , 0 ),
270+ new ParsedShortcode (new Shortcode ('y ' , array ('a ' => '/"// ' ), null , null ), '[y a=/"//] ' , 8 ),
271+ new ParsedShortcode (new Shortcode ('z ' , array (), null , 'http://url/ ' ), '[z=http://url/] ' , 19 ),
272+ new ParsedShortcode (new Shortcode ('a ' , array (), null , 'http://url ' ), '[a=http://url ] ' , 35 ),
273+ );
274+
275+ $ count = count ($ tested );
276+ static ::assertCount ($ count , $ parsed , 'counts ' );
277+ for ($ i = 0 ; $ i < $ count ; $ i ++) {
278+ static ::assertSame ($ tested [$ i ]->getName (), $ parsed [$ i ]->getName (), 'name ' );
279+ static ::assertSame ($ tested [$ i ]->getParameters (), $ parsed [$ i ]->getParameters (), 'parameters ' );
280+ static ::assertSame ($ tested [$ i ]->getContent (), $ parsed [$ i ]->getContent (), 'content ' );
281+ static ::assertSame ($ tested [$ i ]->getText (), $ parsed [$ i ]->getText (), 'text ' );
282+ static ::assertSame ($ tested [$ i ]->getOffset (), $ parsed [$ i ]->getOffset (), 'offset ' );
283+ static ::assertSame ($ tested [$ i ]->getBbCode (), $ parsed [$ i ]->getBbCode (), 'bbCode ' );
284+ }
285+ }
286+
263287 public function testWordPress ()
264288 {
265289 $ parser = new WordpressParser ();
0 commit comments