From: <mlu...@us...> - 2011-09-20 19:21:10
|
Revision: 37461 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=37461&view=rev Author: mlustenberg Date: 2011-09-20 19:21:01 +0000 (Tue, 20 Sep 2011) Log Message: ----------- [ENH] Testing for EditLib (more fixes needed: color specifications cannot be nested) Modified Paths: -------------- trunk/lib/test/editlib/EditLibTest.php Modified: trunk/lib/test/editlib/EditLibTest.php =================================================================== --- trunk/lib/test/editlib/EditLibTest.php 2011-09-20 19:09:33 UTC (rev 37460) +++ trunk/lib/test/editlib/EditLibTest.php 2011-09-20 19:21:01 UTC (rev 37461) @@ -217,6 +217,45 @@ /** + * Nested color specifications + * + * In HTML, color specifications can be nested. + * In Wiki, the colors specifications cannot be nested. + * Hence some reordering is required. + */ + function testParseToWikiNestedColors() { + + $this->markTestIncomplete('Work in progress.'); + /* + * <span><span>text</span></span> + */ + $inData = '<span style="color: rgb(255, 0, 0);">'; + $inData .= '<span style="background-color: rgb(255, 255, 0);">'; + $inData .= 'fg and bg colored'; + $inData .= '</span></span>'; + $res = $this->el->parseToWiki($inData); + $ex = '~~#FF0000, #FFFF00:fg and bg colored~~'; + $this->assertEquals($ex, $res); + + + /* + * <span>text<span>text</span>text</span>text + */ + $inData = '<span style="color: rgb(255, 0, 0);">'; + $inData .= 'fg colored '; + $inData .= '<span style="background-color: rgb(255, 255, 0);">'; + $inData .= 'both colored '; + $inData .= '</span>'; + $inData .= 'fg colored '; + $inData .= '</span>'; + $inData .= 'regular'; + $res = $this->el->parseToWiki($inData); + $ex = '~~#FF0000:fg colored ~~~~#FF0000, #FFFF00:both colored ~~~~#FF0000:fg colored ~~regular'; + $this->assertEquals($ex, $res); + } + + + /** * Nested wiki inline tags * * This test verifies that the tags are written in the correct This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |