Home » Testing » PHPUnit2 » Bug #2460
assertContains should return message on line 2
Details
| Submitted | 2004-10-05 10:23 UTC |
|---|---|
| From | sylvain dot pasche at camptocamp dot com |
| Status | Closed |
| Package | PHPUnit2 |
| PHP Version | 5.0.2 |
| Roadmaps | (Not assigned) |
Comments
[2004-10-05 10:23 UTC] sylvain dot pasche at camptocamp dot com
Description:
------------
$message should be passed to the first assertion of assertContains() method.
Here's a hand made patch:
Before:
public static function assertContains($needle, $haystack, $message = '') {
if (is_string($needle) && is_string($haystack)) {
self::assertTrue(strpos($haystack, $needle) !== FALSE ? TRUE : FALSE);
}
After:
public static function assertContains($needle, $haystack, $message = '') {
if (is_string($needle) && is_string($haystack)) {
self::assertTrue(strpos($haystack, $needle) !== FALSE ? TRUE : FALSE, $message);
}