minor #4054 Fix some inconsistencies (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Fix some inconsistencies

Commits
-------

5148d105 Fix some inconsistencies
This commit is contained in:
Fabien Potencier
2024-04-28 13:16:42 +02:00
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ use Twig\Error\RuntimeError;
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().
@@ -1,5 +1,5 @@
--TEST--
"include" function accepts Twig_Template instance
"include" function accepts Twig\Template instance
--TEMPLATE--
{{ include(foo) }} FOO
--TEMPLATE(foo.twig)--
@@ -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 %}
@@ -1,5 +1,5 @@
--TEST--
"extends" tag accepts Twig_Template instance
"extends" tag accepts Twig\Template instance
--TEMPLATE--
{% extends foo %}
+3 -3
View File
@@ -125,10 +125,10 @@ class CallTest extends TestCase
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()
@@ -156,6 +156,6 @@ class CallableTestClass
}
}
function custom_Twig_Tests_Node_Expression_CallTest_function($required)
function custom_call_test_function($required)
{
}
+2 -2
View File
@@ -28,7 +28,7 @@ class DeprecationCollectorTest extends TestCase
$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);
}
@@ -38,7 +38,7 @@ class DeprecationCollectorTest extends TestCase
}
}
class Twig_Tests_Util_Iterator implements \IteratorAggregate
class Iterator implements \IteratorAggregate
{
public function getIterator(): \Traversable
{