|
From: SourceForge.net <no...@so...> - 2012-01-15 07:39:00
|
Bugs item #3474119, was opened at 2012-01-14 23:39 Message generated for change (Tracker Item Submitted) made by petermeth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3474119&group_id=76550 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Peter Meth (petermeth) Assigned to: Nobody/Anonymous (nobody) Summary: problem testing empty textarea with tidy extension installed Initial Comment: Version: SimpleTest-1.1.alpha3 PHP 5.3.8 - WampServer Windows 7 Ultimate 64-bit I noticed a problem with $this->assertField('fieldname',''); The problem is that when the "tidy" php extension is installed, a different parser is used by SimpleTest. This parser seems to add an extra newline character to blank textarea values, which causes the assert to fail. The same assert passes when the "tidy" extension is not installed. I believe this is a bug in tidy where tidy_parse_string(..) adds a \r to the end of the empty guard (eg. "___EMPTY___\r"). Steps to reproduce problem: Install tidy extension in php put an empty textarea field named fieldname on an html page, then write a simple test with $this->assertField('fieldname',''); The test will fail if your version of tidy has the defect. As a fix, I propose inserting the following before line 77 of tidy_parser.php: // this should fix a bug with textareas where there is an extra \r on the end of the ___EMPTY___ guard. $html = str_replace("___EMPTY___\r", "___EMPTY___", $html); I don't think this should cause any problems even if the problem gets fixed in tidy. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=547455&aid=3474119&group_id=76550 |