[ACCEPTED]-How to force a failure with phpunit-phpunit
Accepted answer
I believe this should work within a test 1 case:
$this->fail('Message');
Another way to do it (especially helpful 1 when writing a testing tool) would be:
use PHPUnit_Framework_ExpectationFailedException as PHPUnitException;
try {
// something here
} catch (SpecificException $e) {
// force a fail:
throw new PHPUnitException("This was not expected.");
}
Yes, theres a way,
$this->fail("your message");
if you want to see the 1 page u have failed than
print_r(getResponse()->getContent());
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.