Skip to content

Commit

Permalink
minor twigphp#4054 Fix some inconsistencies (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

Fix some inconsistencies

Commits
-------

5148d10 Fix some inconsistencies
  • Loading branch information
fabpot committed Apr 28, 2024
2 parents e8df2b7 + 5148d10 commit 1ee72a8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/Extension/EscaperTest.php
Expand Up @@ -17,7 +17,7 @@
use Twig\Extension\EscaperExtension;
use Twig\Loader\LoaderInterface;

class Twig_Tests_Extension_EscaperTest extends TestCase
class EscaperTest extends TestCase
{
/**
* All character encodings supported by htmlspecialchars().
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/functions/include/template_instance.test
@@ -1,5 +1,5 @@
--TEST--
"include" function accepts Twig_Template instance
"include" function accepts Twig\Template instance
--TEMPLATE--
{{ include(foo) }} FOO
--TEMPLATE(foo.twig)--
Expand Down
@@ -1,5 +1,5 @@
--TEST--
"extends" tag with a parent as a Twig_TemplateWrapper instance
"extends" tag with a parent as a Twig\TemplateWrapper instance
--TEMPLATE--
{% extends foo %}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/tags/inheritance/template_instance.test
@@ -1,5 +1,5 @@
--TEST--
"extends" tag accepts Twig_Template instance
"extends" tag accepts Twig\Template instance
--TEMPLATE--
{% extends foo %}

Expand Down
6 changes: 3 additions & 3 deletions tests/Node/Expression/CallTest.php
Expand Up @@ -125,10 +125,10 @@ public function customFunctionWithArbitraryArguments()
public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessageMatches('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#');
$this->expectExceptionMessageMatches('#^The last parameter of "Twig\\\\Tests\\\\Node\\\\Expression\\\\custom_call_test_function" for function "foo" must be an array with default value, eg\\. "array \\$arg \\= \\[\\]"\\.$#');

$node = new Node_Expression_Call([], ['type' => 'function', 'name' => 'foo', 'is_variadic' => true]);
$node->getArguments('Twig\Tests\Node\Expression\custom_Twig_Tests_Node_Expression_CallTest_function', []);
$node->getArguments('Twig\Tests\Node\Expression\custom_call_test_function', []);
}

public function testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject()
Expand Down Expand Up @@ -156,6 +156,6 @@ public function __invoke($required)
}
}

function custom_Twig_Tests_Node_Expression_CallTest_function($required)
function custom_call_test_function($required)
{
}
4 changes: 2 additions & 2 deletions tests/Util/DeprecationCollectorTest.php
Expand Up @@ -28,7 +28,7 @@ public function testCollect()
$twig->addFunction(new TwigFunction('deprec', [$this, 'deprec'], ['deprecated' => '1.1']));

$collector = new DeprecationCollector($twig);
$deprecations = $collector->collect(new Twig_Tests_Util_Iterator());
$deprecations = $collector->collect(new Iterator());

$this->assertEquals(['Twig Function "deprec" is deprecated since version 1.1 in deprec.twig at line 1.'], $deprecations);
}
Expand All @@ -38,7 +38,7 @@ public function deprec()
}
}

class Twig_Tests_Util_Iterator implements \IteratorAggregate
class Iterator implements \IteratorAggregate
{
public function getIterator(): \Traversable
{
Expand Down

0 comments on commit 1ee72a8

Please sign in to comment.