Skip to content

[PHPUnit60] Skip Twig IntegrationTestCase children in AddDoesNotPerformAssertionToNonAssertingTestRector - #762

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-twig-integration-test-case
Aug 8, 2026
Merged

[PHPUnit60] Skip Twig IntegrationTestCase children in AddDoesNotPerformAssertionToNonAssertingTestRector#762
TomasVotruba merged 1 commit into
mainfrom
skip-twig-integration-test-case

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

\Twig\Test\IntegrationTestCase children got @doesNotPerformAssertions added, even though the parent class asserts inside doIntegrationTest().

The assert-call walker only sees the child method calling $this->doIntegrationTest(...); the assertions live deeper in the Twig parent, so the rule concluded nothing is asserted.

 use Twig\Test\IntegrationTestCase;
final class SomeTwigExtensionTest extends IntegrationTestCase
{
- /**- * @doesNotPerformAssertions- */
public function testIntegration($file, $message, $condition, $templates, $exception, $outputs)
{
$this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs);
}
}

Now such class methods are skipped. The check uses ClassReflection::is(), so intermediate abstract test cases extending IntegrationTestCase are skipped too.

@TomasVotruba
TomasVotruba merged commit 6ad762b into mainAug 8, 2026
7 checks passed
@TomasVotruba
TomasVotruba deleted the skip-twig-integration-test-case branch August 8, 2026 11:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@TomasVotruba