Twig icon indicating copy to clipboard operation
Twig copied to clipboard

IntegrationTestCase: Compatibility with PHPUnit 10

Open SiebelsTim opened this issue 2 years ago • 4 comments

PHPUnit 10 has breaking changes regarding data providers. These must be static now.

However, \Twig\Test\IntegrationTestCase uses non-static data providers.

The errors look like this:

* Data Provider method MyTest::getTests() is not static                                                                                  
                                                                                                                                                                                                                   
* Data Provider method MyTest::getTests() expects an argument    

Unfortunately, the needed change looks like a breaking change. IntegrationTestCase::getTests depends on $this->getFixturesDir() which is abstract. Consumers would need to change this as well then.

SiebelsTim avatar Feb 10 '23 09:02 SiebelsTim

@SiebelsTim Would you like to work on a PR on the 3.x branch to improve the current situation?

fabpot avatar Feb 10 '23 12:02 fabpot

Are there any plans to push that forward? Unfortunately this is the last thing blocking us from upgrading to newer PHPUnit versions.

Looking on #3813, I cannot exactly see why that was not merged or the review was continued in those days. @stof and @GromNaN: Is there something I can do to help finish this PR?

FelixJacobi avatar Jul 25 '24 10:07 FelixJacobi

@FelixJacobi I'm not sure I understand: are you testing TwigPHP on your own projects?

ericmorand avatar Jul 25 '24 11:07 ericmorand

I am testing Twig extensions using the IntegrationTestCase.

FelixJacobi avatar Jul 25 '24 11:07 FelixJacobi