mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-24 17:16:24 +00:00
feature #4265 Migrate NodeTestCase to static data providers (derrabus)
This PR was merged into the 3.x branch.
Discussion
----------
Migrate NodeTestCase to static data providers
PHPUnit 11 requires data providers to be static. This PR prepares our abstract `NodeTestCase` by deprecating the non-static `getTests()` and adding a static `provideTests()` as a replacement. I've also added PHPUnit attributes which newer PHPUnit releases prefer over PHPDoc annotations.
Commits
-------
f555a33c Migrate NodeTestCase to static data providers
This commit is contained in:
@@ -23,8 +23,6 @@ use Twig\Node\Node;
|
||||
use Twig\Node\SetNode;
|
||||
use Twig\Node\TextNode;
|
||||
use Twig\Source;
|
||||
use Twig\Template;
|
||||
use Twig\TemplateWrapper;
|
||||
use Twig\Test\NodeTestCase;
|
||||
|
||||
class ModuleTest extends NodeTestCase
|
||||
@@ -46,7 +44,7 @@ class ModuleTest extends NodeTestCase
|
||||
$this->assertEquals($source->getName(), $node->getTemplateName());
|
||||
}
|
||||
|
||||
public function getTests()
|
||||
public static function provideTests(): iterable
|
||||
{
|
||||
$twig = new Environment(new ArrayLoader(['foo.twig' => '{{ foo }}']));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user