Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 10, 2025
1 parent ef7ade8 commit 9bcf837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/ExpressionParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public function testUnaryPrecedenceChange()
{
$env = new Environment(new ArrayLoader(), ['cache' => false, 'autoescape' => false]);
$env->addExtension(new class () extends AbstractExtension {
public function getOperators()
public function getOperators(): array
{
$class = new class (new ConstantExpression('foo', 1), 1) extends AbstractUnary {
public function operator(Compiler $compiler): Compiler
Expand Down
2 changes: 1 addition & 1 deletion tests/Node/Expression/Variable/ContextVariableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function provideTests(): iterable

// regular
$node = new ContextVariable('foo', 1);
$output = '(isset($context["foo"]) || array_key_exists("foo", $context) ? $context["foo"] : (function () { throw new RuntimeError(\'Variable "foo" does not exist.\', 1, $this->source); })())';
$output = '(array_key_exists("foo", $context) ? $context["foo"] : throw new RuntimeError(\'Variable "foo" does not exist.\', 1, $this->source))';
yield 'strict' => [$node, "// line 1\n".$output, $envStrict];
yield 'non_strict' => [$node, self::createVariableGetter('foo', 1), $env];

Expand Down

0 comments on commit 9bcf837

Please sign in to comment.