PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Testing » PHPUnit2 » Bug #2460

assertContains should return message on line 2

Details

Submitted2004-10-05 10:23 UTC
Fromsylvain dot pasche at camptocamp dot com
StatusClosed
PackagePHPUnit2
PHP Version5.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);
}