|
From: Jason S. <jsw...@ya...> - 2009-10-21 15:26:47
|
Hi Nicolas,
Your code throws an exception, and does not raise an error, so the unit test is telling you that. Everything appears to be working as expected with SimpleTest.
Regards,
Jason
________________________________
From: Nicolas Terray <nic...@gm...>
To: "Help, advice, bugs and workarounds" <sim...@li...>
Sent: Wed, October 21, 2009 10:10:57 AM
Subject: [Simpletest-support] Strange behavior with expectError
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
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Simpletest-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simpletest-support
|