@@ -252,7 +252,7 @@ public function provideShortcodes()
252252 *
253253 * Tests cases from array above with identifiers in the array below must be skipped.
254254 */
255- $ wordpressSkip = array (3 , 6 , 16 , 21 , 22 , 23 , 25 , 32 , 33 , 34 , 46 , 47 , 49 , 51 );
255+ $ wordpressSkip = array (3 , 6 , 16 , 21 , 22 , 23 , 25 , 32 , 33 , 34 , 46 , 47 , 49 , 51 , 52 );
256256 $ result = array ();
257257 foreach ($ tests as $ key => $ test ) {
258258 $ syntax = array_shift ($ test );
@@ -276,12 +276,35 @@ public function testIssue77()
276276 new ParsedShortcode (new Shortcode ('x ' , array (), '' , null ), '[x][/x] ' , 3 ),
277277 new ParsedShortcode (new Shortcode ('y ' , array (), 'x ' , null ), '[y]x[/y] ' , 22 ),
278278 ));
279-
280279 $ this ->assertShortcodes ($ parser ->parse ('[a k="v][x][/x] ' ), array (
281280 new ParsedShortcode (new Shortcode ('x ' , array (), '' , null ), '[x][/x] ' , 8 ),
282281 ));
283282 }
284283
284+ public function testValueModeAggressive ()
285+ {
286+ $ parser = new RegularParser (new CommonSyntax ());
287+ $ parser ->valueMode = RegularParser::VALUE_AGGRESSIVE ;
288+ $ parsed = $ parser ->parse ('[x=/[/] [y a=/"//] [z=http://url/] [a=http://url ] ' );
289+ $ tested = array (
290+ new ParsedShortcode (new Shortcode ('x ' , array (), null , '/[/ ' ), '[x=/[/] ' , 0 ),
291+ new ParsedShortcode (new Shortcode ('y ' , array ('a ' => '/"// ' ), null , null ), '[y a=/"//] ' , 8 ),
292+ new ParsedShortcode (new Shortcode ('z ' , array (), null , 'http://url/ ' ), '[z=http://url/] ' , 19 ),
293+ new ParsedShortcode (new Shortcode ('a ' , array (), null , 'http://url ' ), '[a=http://url ] ' , 35 ),
294+ );
295+
296+ $ count = count ($ tested );
297+ static ::assertCount ($ count , $ parsed , 'counts ' );
298+ for ($ i = 0 ; $ i < $ count ; $ i ++) {
299+ static ::assertSame ($ tested [$ i ]->getName (), $ parsed [$ i ]->getName (), 'name ' );
300+ static ::assertSame ($ tested [$ i ]->getParameters (), $ parsed [$ i ]->getParameters (), 'parameters ' );
301+ static ::assertSame ($ tested [$ i ]->getContent (), $ parsed [$ i ]->getContent (), 'content ' );
302+ static ::assertSame ($ tested [$ i ]->getText (), $ parsed [$ i ]->getText (), 'text ' );
303+ static ::assertSame ($ tested [$ i ]->getOffset (), $ parsed [$ i ]->getOffset (), 'offset ' );
304+ static ::assertSame ($ tested [$ i ]->getBbCode (), $ parsed [$ i ]->getBbCode (), 'bbCode ' );
305+ }
306+ }
307+
285308 public function testWordPress ()
286309 {
287310 $ parser = new WordpressParser ();
0 commit comments