|
From: Jason S. <jsw...@ya...> - 2009-09-13 20:19:53
|
Hi Mikkel,
The error reporting will respond to the currently specified error reporting level, suppressing notices if you have requested it (perhaps defaulted via php.ini)
Try adding
error_reporting(E_ALL|E_STRICT);
To the top of your script.
Regards,
Jason
________________________________
From: Mikkel N. Rasmussen <mik...@th...>
To: sim...@li...
Sent: Saturday, September 12, 2009 8:08:43 AM
Subject: [Simpletest-support] How is SimpleTestErrorHandler supposed to work?
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
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Simpletest-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simpletest-support
|