VincentLanglet / Twig-CS-Fixer

A tool to automatically fix Twig Coding Standards issues
MIT License
231 stars 25 forks source link

AbstractRuleTestCase is not part of the Composer package #316

Closed zacharylund closed 3 weeks ago

zacharylund commented 3 weeks ago

I found it incredibly easy to write a custom rule for my project. (Thank you!) However, I found it challenging to write PHPUnit tests for that custom rule.

I think \TwigCsFixer\Tests\Rules\AbstractRuleTestCase (and maybe other test cases) should be moved from tests/ to src/ so that it is available when installed as a Composer dependency.

Unless there's a way to do this that I'm missing. Thoughts?

Expected behavior

I can extend \TwigCsFixer\Tests\Rules\AbstractRuleTestCase in my own codebase.

Actual behavior

\TwigCsFixer\Tests\Rules\AbstractRuleTestCase does not exist.

VincentLanglet commented 3 weeks ago

You will also need TestHelper.

You can try to move these class to a

src/Test/

folder and open a PR. We'll see the impacts.