|
From: Mikkel N. R. <mik...@th...> - 2009-09-12 14:08:48
|
Hi
I have a situation here. I use version 1.0.1 of SimpleTest, and some
logical errors seems to be supressed...
If I run the following code:
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
class DamagedLogic
{
public function damagedFunction()
{
* // Should generate some kind of error.
return $notDefinedVariable;
* }
}
class DamageTestCase extends UnitTestCase {
function testDamagedFunction() {
$damagedLogic = new DamagedLogic();
$damagedLogic->damagedFunction();
}
}
$test = &new DamageTestCase();
$test->run(new HtmlReporter());
?>
which sould generate some kind of error since the $notDefinedVariable is
not defined, the test is reported as passing. When I step through the
code, I see that the SimpleTestErrorHandler gets invoked, but still, no
errors gets reported. The code documentation for the
SimpleTestErrorHandler is:
/**
* Error handler that simply stashes any errors into the global
* error queue. Simulates the existing behaviour with respect to
* logging errors, but this feature may be removed in future.
* @param $severity PHP error code.
* @param $message Text of error.
* @param $filename File error occoured in.
* @param $line Line number of error.
* @param $super_globals Hash of PHP super global arrays.
* @static
* @access public
*/
But is does not help me muct.
What am I missing here?
Regards,
Mikkel
|