Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

phpunit exception message contains string

try {
    $myClass->validate(1, 2, 4, 3);
    $this->fail( "Exception with 101 code should be thrown" );
} catch (Exception $e) {
    $this->assertEquals( 101, $e->getCode());
}
Source by localcoder.org #
 
PREVIOUS NEXT
Tagged: #phpunit #exception #message #string
ADD COMMENT
Topic
Name
9+5 =