mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-10 01:16:52 +00:00
fixed tests for PHP 7.4
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Twig\Tests;
|
||||
*/
|
||||
|
||||
use Twig\Environment;
|
||||
use Twig\Node\MacroNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\SetNode;
|
||||
use Twig\Node\TextNode;
|
||||
@@ -29,7 +30,7 @@ class ParserTest extends \PHPUnit\Framework\TestCase
|
||||
public function testSetMacroThrowsExceptionOnReservedMethods()
|
||||
{
|
||||
$parser = $this->getParser();
|
||||
$parser->setMacro('parent', $this->getMockBuilder('\Twig\Node\MacroNode')->disableOriginalConstructor()->getMock());
|
||||
$parser->setMacro('parent', new MacroNode('foo', new Node(), new Node(), 1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,8 @@ class TemplateTest extends \PHPUnit\Framework\TestCase
|
||||
*/
|
||||
public function testDisplayBlocksAcceptTemplateOnlyAsBlocks()
|
||||
{
|
||||
$template = $this->getMockForAbstractClass('\Twig\Template', [], '', false);
|
||||
$twig = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock());
|
||||
$template = new TemplateForTest($twig);
|
||||
$template->displayBlock('foo', [], ['foo' => [new \stdClass(), 'foo']]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user