Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

phpunit assert continue

public function testDemo()
{
    $failures = [];
    try {
        $this->assertTrue(false);
    } catch(PHPUnit_Framework_ExpectationFailedException $e) {
        $failures[] = $e->getMessage();
    }
    try {
        $this->assertTrue(false);
    } catch(PHPUnit_Framework_ExpectationFailedException $e) {
        $failures[] = $e->getMessage();
    }
    if(!empty($failures))
    {
        throw new PHPUnit_Framework_ExpectationFailedException (
            count($failures)." assertions failed:
	".implode("
	", $failures)
        );
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #phpunit #assert #continue
ADD COMMENT
Topic
Name
5+1 =