Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Skipped test when using IntegrationTestCase with no legacy tests

Open iquito opened this issue 7 months ago • 3 comments

When doing Twig tests extending Twig\Test\IntegrationTestCase there is a skipped test if no legacy tests are defined:

There was 1 skipped test:

1) MyTests\IntegrationTest::testLegacyIntegration with data set #0 ('not', '-', '', array(), '', array())
no tests to run

This is coming from testLegacyIntegration in IntegrationTestCase, and specifically the beginning of doIntegrationTests:

if (!$outputs) {
    $this->markTestSkipped('no tests to run');
}

iquito avatar May 02 '25 17:05 iquito

What did you expect to happen instead?

xabbuh avatar May 02 '25 18:05 xabbuh

Legacy tests are not documented as far as I know, I assume those are for tests of features/behavior which will be removed? As somebody using IntegrationTestCase to test an extension I would expect to have no skipped tests if no legacy tests are defined (as I would assume legacy tests are mostly used by Twig itself, not people who extend Twig), for example by Twig doing a dummy test (like $this->assertTrue(true);) if no legacy tests are defined, as otherwise you will be unsure if tests are maybe skipped by accident or something is wrong with the test suite. At least that was my reaction - I thought maybe a legitimate test was skipped and that I could not trust the test results, only to find out Twig skipped tests that were not defined anyway.

iquito avatar May 02 '25 18:05 iquito

Twig extensions might need their own legacy tests, if they provide deprecated filters or functions.

stof avatar Oct 24 '25 14:10 stof