From 0947777bc64b83cb16ef6298a3fc6d1cef2a82e6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 30 Jun 2019 15:16:08 +0200 Subject: [PATCH] fixed tests for PHP 7.4 --- tests/ParserTest.php | 3 ++- tests/TemplateTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 7e751d118..d529bbb5e 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -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)); } /** diff --git a/tests/TemplateTest.php b/tests/TemplateTest.php index 472113684..5314e23b1 100644 --- a/tests/TemplateTest.php +++ b/tests/TemplateTest.php @@ -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']]); }