svn: /pear/packages/Text_Wiki/trunk/tests/ Text_Wiki_BugTests.php

From: Date: Sat, 19 Mar 2011 18:42:20 +0000
Subject: svn: /pear/packages/Text_Wiki/trunk/tests/ Text_Wiki_BugTests.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-61497@lists.php.net to get a copy of this message
till Sat, 19 Mar 2011 18:42:20 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309445 Log: * add testcase for bugs, #18289 Bug: http://pear.php.net/bugs/18289 (unknown) Changed paths: A + pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php (from pear/packages/Text_Wiki/trunk/tests/Text_Wiki_Generic_Transform_Tests.php:r309444) Copied: pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php (from rev 309444, pear/packages/Text_Wiki/trunk/tests/Text_Wiki_Generic_Transform_Tests.php) =================================================================== --- pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php (rev 0) +++ pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php 2011-03-19 18:42:20 UTC (rev 309445) @@ -0,0 +1,31 @@ +<?php + +require_once 'PHPUnit/Framework/TestCase.php'; +require_once 'Text/Wiki.php'; + +// class to test the Text_Wiki::transform() with different wiki markups +class Text_Wiki_BugTests extends PHPUnit_Framework_TestCase +{ + /** + * @see http://pear.php.net/bugs/bug.php?id=18289 + */ + public function test18289() + { + $text = <<<EOT +* level one + * level two +* level one + * level two +EOT; + + $wiki = new Text_Wiki(); + $html = $wiki->transform($text); + + // strip all whitespace to make assertEquals() easier + $html = preg_replace('/\s+/','',$html); + + $assertion = '<ul><li>level one<ul><li>level two</li></ul></li>'; + $assertion .= '<li>level one<ul><li>level two</li></ul></li></ul>'; + $this->assertEquals($assertion, $html); + } +}

« previous php.pear.cvs (#61497) next »