]> Raphaƫl G. Git Repositories - bbcode/blobdiff - tests/003.phpt
Remove old useless test
[bbcode] / tests / 003.phpt
index 36c39318bd512a37c2abf27781947639b58dd66b..f9b036236ebde8a203c14f7d240d08ca5ef2475f 100644 (file)
@@ -1,51 +1,13 @@
 --TEST--
 --TEST--
-Check for bbcode clone
+Check for missing tag arg
 --SKIPIF--
 <?php if (!extension_loaded("bbcode")) print "skip"; ?>
 --FILE--
 <?php
 --SKIPIF--
 <?php if (!extension_loaded("bbcode")) print "skip"; ?>
 --FILE--
 <?php
-$obj = new bbcode(
-       [
-               '' => [
-                       'type' => BBCODE::TYPE_ROOT,
-                       'child' => ['ul','url','img','b','i']
-               ],
-               'i' => [
-                       'type' => BBCODE::TYPE_MULTI
-                       //TODO: by default open tag = <KEY> and close tag = </KEY>
-               ],
-               'b' => [
-                       'type' => BBCODE::TYPE_MULTI
-               ],
-               'ul' => [
-                       'type' => BBCODE::TYPE_MULTI,
-                       'child' => [ 'li' ]
-               ],
-               'li' => [
-                       'type' => BBCODE::TYPE_MULTI,
-                       'parent' => 'ul',
-                       'child' => ['url','img','b','i']
-               ],
-               'url' => [
-                       'type' => BBCODE::TYPE_MULTI,
-                       'parent' => [ '', 'li', 'b', 'i', null, 'toto', 0, 42 ],
-                       'open' => '<a href="{PARAM}">',
-                       'close' => '</a>',
-                       'default' => '{CONTENT}'
-               ]
-       ],
-       [
-               ':)' => '<img src="smiley.gif" alt=":)" />',
-               ':(' => '<img src="sad.gif" alt=":(" />',
-               ':D' => '<img src="happy.gif" alt=":D" />',
-               ':p' => '<img src="tong.gif" alt=":p" />',
-               ':|' => '<img src="special.gif" alt=":|" />',
-               ':6:' => '<img src="six.gif" alt=":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]');
-?>
+try {
+       $obj = new bbcode();
+} catch (Exception $e) {
+       echo $e->getMessage();
+}
 --EXPECT--
 --EXPECT--
-[ul][li][url=https://rapsys.eu]Rapsys[/url][/li][li][url=https://google.fr]Google[/url][/li][/ul]
+BBCode::__construct() expects at least 1 parameter, 0 given