sebastianbergmann/phpunit-selenium — Issue #78: Fatal error: Call to undefined method PHPUnit_Framework_ExpectationFailedException::getCustomMessage() in /phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumTestCase.php on line 1041
Author: benjamin-rentabiliweb
Created: 2011-11-30 15:00:06+00:00
State: open

I posted the bug on http://stackoverflow.com/questions/7629312/phpunit-selenium-error/8327563

When I check the class PHPUnit_Framework_ExpectationFailedException, I found the following line :

public function __construct($message, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL)
Indeed, the second parameter has to be an object and not a string but if I check the class SeleniumTestCase, I can see :

if ($e instanceof PHPUnit_Framework_ExpectationFailedException) {
if (is_object($e->getComparisonFailure())) {
$message = $e->getComparisonFailure()->toString();
} else {
$message = $e->getMessage();
}

$buffer .= "\n" . $message;

throw new PHPUnit_Framework_ExpectationFailedException($buffer, $message);
The $message seems to be a string and not an object.

Can you help me ? PS : I am using the version of phpunit (3.6.4) and the last version of selenium (1.1.1)