|
From: Nicolas T. <nic...@gm...> - 2009-10-21 15:11:14
|
Hi,
<?php
class A {
function m() {
throw new Exception('Woohoo');
}
}
class ErrorTest extends UnitTestCase {
function test_m1() {
$a = new A();
$this->expectException('Exception');
$this->expectError();
$a->m();
}
function test_m2() {
}
}
?>
The test fails:
-> ErrorTest -> test_m2 -> Expected true, got [Boolean: false] ->
Expected error not caught
Why does the message refers to test_m2() ? Where does this true/false
check come from?
Strange, isn't it?
If I remove the test_m2() method or the expectError, it goes green.
Yours,
Nicolas Terray
|