Unit tests with debug()

SVN:trunk[5348]
This commit is contained in:
Eric Espié
2018-02-16 08:14:29 +00:00
parent bddba15403
commit b8fc24f093
3 changed files with 139 additions and 49 deletions

View File

@@ -27,7 +27,7 @@ namespace Combodo\iTop\Test\UnitTest;
use PHPUnit\Framework\TestCase;
define('DEBUG_UNIT_TEST', false);
define('DEBUG_UNIT_TEST', true);
class ItopTestCase extends TestCase
{
@@ -37,14 +37,21 @@ class ItopTestCase extends TestCase
@include_once '../../approot.inc.php';
@include_once '../../../approot.inc.php';
$this->debug("\n----------\n---------- ".$this->getName()."\n----------\n\n");
$this->debug("\n----------\n---------- ".$this->getName()."\n----------\n");
}
protected function debug($sMsg)
{
if (DEBUG_UNIT_TEST)
{
echo $sMsg;
if (is_string($sMsg))
{
echo "$sMsg\n";
}
else
{
print_r($sMsg);
}
}
}
}