Re: BBCodeParser (CVS commit(s))

From: Date: Fri, 14 Oct 2005 16:37:45 +0000
Subject: Re: BBCodeParser (CVS commit(s))
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-40191@lists.php.net to get a copy of this message
I'm going to try to reply to two emails at once here. I downloaded the new source CVS and modified my test cases to work directly on HTML_BBCodeParser (instead of my wrapper class). BBCodeParser passes my testcases just fine, but it only tests through the qparse method (which internally uses other methods). Feel free to add more testcases. I attached my testcases to the end of my last email, but I don't think that anyone noticed them. This time I've zipped them and put them on my website: http://pricepages.org/bbcode/BBCodeParser.phpt.zip They require PHPUnit. You can run the test cases by running the script from the command line ("php -f BBCodeParser.phpt"). I was also asked to look at the patch here: http://news.php.net/php.pear.cvs/35523 I applied the patch to the latest CVS sources and it still passes my original testcases, but it dies on the new function removeFilter(). I've included the new tests in my testcases, but commented out. Note that this is after I fixed one bug that occurs when you create the object with an empty string for filters. Here is the patch for that bug: --- BBCodeParser_CVS_patch.php 2005-10-14 10:58:10.000000000 -0500
+++ BBCodeParser.php    2005-10-14 11:27:21.000000000 -0500
@@ -276,7 +276,9 @@
             return;
         }
         foreach ($filters as $filter) {
-            $this->addFilter($filter);
+           if(trim($filter)){
+               $this->addFilter($filter);
+           }
         }
     }
The removeFilter() bug occurs because the tags need to be removed from $_definedTags in addition to the filter being removed from $_filters. I'll let you fix that one :). Please update your patch to include fixes for the two problems that I found. ~Seth On Oct 14, 2005, at 2:08 AM, Arnaud Limbourg wrote:
Hi Seth, I committed your patches to the code, please check out latest CVS and tell me if it is correct. The diff can be seen here: http://news.php.net/php.pear.cvs/35503 Don't hesitate to review the diff. I've unpacked your zip archive on a fresh checkout and committed the whole thing. Arnaud. Seth Price wrote:
It would be fine with me. I don't have commit access/experience though. ~Seth On Oct 13, 2005, at 5:04 AM, Lukas Smith wrote:
independent of this .. can we get those bug fixes commited? regards, Lukas --PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#40191) next »