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

From: Date: Sat, 19 Mar 2011 18:58:28 +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-61498@lists.php.net to get a copy of this message
till Sat, 19 Mar 2011 18:58:28 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309446 Log: * test seems to work standalone only * switched to factory(), apparently __construct is deprecated Changed paths: U pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php Modified: pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php =================================================================== --- pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php 2011-03-19 18:42:20 UTC (rev 309445) +++ pear/packages/Text_Wiki/trunk/tests/Text_Wiki_BugTests.php 2011-03-19 18:58:28 UTC (rev 309446) @@ -6,26 +6,37 @@ // class to test the Text_Wiki::transform() with different wiki markups class Text_Wiki_BugTests extends PHPUnit_Framework_TestCase { + protected $wiki; + + protected function setUp() + { + $this->wiki = Text_Wiki::factory('Default'); + } + + protected function tearDown() + { + unset($this->wiki); + } + /** * @see http://pear.php.net/bugs/bug.php?id=18289 */ public function test18289() { $text = <<<EOT -* level one - * level two -* level one - * level two +* level1 + * level2 +* level1 + * level2 EOT; - $wiki = new Text_Wiki(); - $html = $wiki->transform($text); + $html = $this->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>'; + $assertion = '<ul><li>level1<ul><li>level2</li></ul></li>'; + $assertion .= '<li>level1<ul><li>level2</li></ul></li></ul>'; $this->assertEquals($assertion, $html); } }

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