From 2d6495ed5c357dbfcfbd6aedf6b24b406225e128 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 8 Jan 2019 18:59:32 +0100 Subject: [PATCH 1/1] Switch to single|root|multi type Adapt to new data structure --- tests/002.phpt | 30 ++++++++++++++++-------------- tests/003.phpt | 26 +++++++++++++------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/tests/002.phpt b/tests/002.phpt index a1359a4..b9d101a 100644 --- a/tests/002.phpt +++ b/tests/002.phpt @@ -6,33 +6,35 @@ Check for bbcode functions [ + ], '' => [ 'type' => BBCODE::TYPE_ROOT, - 'childs' => ['ul','url','img','b','i'] + 'child' => ['ul','url','img','b','i'] ], 'i' => [ - 'type' => BBCODE::TYPE_NOARG + 'type' => BBCODE::TYPE_MULTI //TODO: by default open tag = and close tag = ], 'b' => [ - 'type' => BBCODE::TYPE_NOARG + 'type' => BBCODE::TYPE_MULTI ], 'ul' => [ - 'type' => BBCODE::TYPE_NOARG, - 'childs' => [ 'li' ] + 'type' => BBCODE::TYPE_MULTI, + 'child' => ['li'] ], 'li' => [ - 'type' => BBCODE::TYPE_NOARG, - 'parent' => 'ul', - 'childs' => ['url','img','b','i'] + 'type' => BBCODE::TYPE_MULTI, + 'parent' => ['ul'], + 'child' => ['url','img','b','i'] ], 'url' => [ - 'type' => BBCODE::TYPE_OPTARG, - 'open_tag' => '', - 'close_tag' => '', - 'default_arg' => '{CONTENT}', - 'parent' => [ '', 'li', 'b', 'i' ] - ] + 'type' => BBCODE::TYPE_MULTI, + 'parent' => ['','li','b','i'], + 'open' => '', + 'close' => '', + 'arg' => 'href' + ], ], [ ':)' => ':)', diff --git a/tests/003.phpt b/tests/003.phpt index 0e30488..36c3931 100644 --- a/tests/003.phpt +++ b/tests/003.phpt @@ -8,30 +8,30 @@ $obj = new bbcode( [ '' => [ 'type' => BBCODE::TYPE_ROOT, - 'childs' => ['ul','url','img','b','i'] + 'child' => ['ul','url','img','b','i'] ], 'i' => [ - 'type' => BBCODE::TYPE_NOARG + 'type' => BBCODE::TYPE_MULTI //TODO: by default open tag = and close tag = ], 'b' => [ - 'type' => BBCODE::TYPE_NOARG + 'type' => BBCODE::TYPE_MULTI ], 'ul' => [ - 'type' => BBCODE::TYPE_NOARG, - 'childs' => [ 'li' ] + 'type' => BBCODE::TYPE_MULTI, + 'child' => [ 'li' ] ], 'li' => [ - 'type' => BBCODE::TYPE_NOARG, + 'type' => BBCODE::TYPE_MULTI, 'parent' => 'ul', - 'childs' => ['url','img','b','i'] + 'child' => ['url','img','b','i'] ], 'url' => [ - 'type' => BBCODE::TYPE_OPTARG, - 'open_tag' => '', - 'close_tag' => '', - 'default_arg' => '{CONTENT}', - 'parent' => [ '', 'li', 'b', 'i' ] + 'type' => BBCODE::TYPE_MULTI, + 'parent' => [ '', 'li', 'b', 'i', null, 'toto', 0, 42 ], + 'open' => '', + 'close' => '', + 'default' => '{CONTENT}' ] ], [ @@ -40,7 +40,7 @@ $obj = new bbcode( ':D' => ':D', ':p' => ':p', ':|' => ':|', - ':6:' => ':6:' + ':6:' => ':6:', ], BBCODE::REMOVE_EMPTY ); -- 2.41.1