mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°8772 - Form dependencies manager implementation
- Form SDK implementation - Basic Forms - Dynamics Forms - Basic Blocks + Data Model Block - Form Compilation - Turbo integration
This commit is contained in:
@@ -10,9 +10,11 @@ namespace Combodo\iTop\Test\UnitTest;
|
||||
use CMDBSource;
|
||||
use DeprecatedCallsLog;
|
||||
use MySQLTransactionNotClosedException;
|
||||
use ParseError;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use ReflectionMethod;
|
||||
use SetupUtils;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
use const DEBUG_BACKTRACE_IGNORE_ARGS;
|
||||
@@ -583,6 +585,23 @@ abstract class ItopTestCase extends KernelTestCase
|
||||
self::assertLessThan(2, $iTimeInterval, $sMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 3.3.0
|
||||
*/
|
||||
protected static function AssertPHPCodeIsValid(string $sPHPCode, $sMessage = ''): void
|
||||
{
|
||||
try {
|
||||
eval($sPHPCode);
|
||||
} catch (ParseError $e) {
|
||||
$aLines = explode("\n", $sPHPCode);
|
||||
foreach ($aLines as $iLine => $sLine) {
|
||||
echo sprintf("%02d: %s\n", $iLine + 1, $sLine);
|
||||
}
|
||||
echo 'Parse Error: '.$e->getMessage().' at line: '.$e->getLine()."\n";
|
||||
self::fail($sMessage);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Control which Kernel will be loaded when invoking the bootKernel method
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user