mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°4867 - "Twig content not allowed" error when use the extkey widget search icon in the user portal - Add tests
This commit is contained in:
35
test/twig/TwigTest.php
Normal file
35
test/twig/TwigTest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Combodo\iTop\Test\UnitTest;
|
||||
|
||||
use AppBundle\Twig\AppExtension;
|
||||
use Combodo\iTop\Application\TwigBase\Twig\TwigHelper;
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
|
||||
class TwigTest extends ItopTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Test the fix for ticket N°4384
|
||||
*
|
||||
* @dataProvider testTemplateProvider
|
||||
*
|
||||
*/
|
||||
public function testTemplate($sFileName, $expected)
|
||||
{
|
||||
$oTwig = TwigHelper::GetTwigEnvironment( dirname(__FILE__));
|
||||
|
||||
$sHtml = $oTwig->render($sFileName.'.twig');
|
||||
$this->assertSame($sHtml, $expected);
|
||||
}
|
||||
|
||||
public static function testTemplateProvider()
|
||||
{
|
||||
$aReturn = array();
|
||||
$aReturn['filter_system'] = [
|
||||
'sFileName' => 'test.html',
|
||||
'expected' =>file_get_contents(dirname(__FILE__).'/test.html'),
|
||||
];
|
||||
|
||||
return $aReturn;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user