X-Git-Url: https://git.rapsys.eu/bbcode/blobdiff_plain/8cc088253d4b78f773237d2f5155a7535e51a917..c984cf9f2a00294d69fa29da1c299b7996ccf399:/tests/003.phpt?ds=inline
diff --git a/tests/003.phpt b/tests/003.phpt
new file mode 100644
index 0000000..0e30488
--- /dev/null
+++ b/tests/003.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Check for bbcode clone
+--SKIPIF--
+
+--FILE--
+ [
+ 'type' => BBCODE::TYPE_ROOT,
+ 'childs' => ['ul','url','img','b','i']
+ ],
+ 'i' => [
+ 'type' => BBCODE::TYPE_NOARG
+ //TODO: by default open tag = and close tag =
+ ],
+ 'b' => [
+ 'type' => BBCODE::TYPE_NOARG
+ ],
+ 'ul' => [
+ 'type' => BBCODE::TYPE_NOARG,
+ 'childs' => [ 'li' ]
+ ],
+ 'li' => [
+ 'type' => BBCODE::TYPE_NOARG,
+ 'parent' => 'ul',
+ 'childs' => ['url','img','b','i']
+ ],
+ 'url' => [
+ 'type' => BBCODE::TYPE_OPTARG,
+ 'open_tag' => '',
+ 'close_tag' => '',
+ 'default_arg' => '{CONTENT}',
+ 'parent' => [ '', 'li', 'b', 'i' ]
+ ]
+ ],
+ [
+ ':)' => '',
+ ':(' => '',
+ ':D' => '',
+ ':p' => '',
+ ':|' => '',
+ ':6:' => ''
+ ],
+ BBCODE::REMOVE_EMPTY
+);
+$cln = clone $obj;
+echo $cln->parse('[ul][li][url=https://rapsys.eu]Rapsys[/url][/li][li][url=https://google.fr]Google[/url][/li][/ul]');
+?>
+--EXPECT--
+[ul][li][url=https://rapsys.eu]Rapsys[/url][/li][li][url=https://google.fr]Google[/url][/li][/ul]