0

I get this error when I run phpunit with selenium.

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)

2 Answers 2

1

In PHPUnit 3.6 PHPUnit_Framework_ExpectationFailedException was changed by removing the second optional custom message. It looks like phpunit-selenium hasn't been updated with this change yet. You can downgrade to PHPUnit 3.5.x in the meantime or fix it and submit a pull request.

Sign up to request clarification or add additional context in comments.

Comments

0

The bug has been fixed in the master branch and will be rolled out in the release after 1.1.1. https://github.com/sebastianbergmann/phpunit-selenium/issues/78

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.