Skipped test when using IntegrationTestCase with no legacy tests
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');
}
What did you expect to happen instead?
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.
Twig extensions might need their own legacy tests, if they provide deprecated filters or functions.