Unit test: detecting an original fixture file path #6245
Unanswered
AlexeyOnsite
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi, we're aware of this and welcome any improvement. You can find some inspiration in this rule, that checks a new file was added: |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
first of all thank you for this great tool :)
I'm developing a fairly complex rule to automatically convert old spagetti code into Symfony controller (similar to your inspirational article "How to Migrate Spaghetti to 304 Symfony 5 Controllers Over Weekend" I guess).
The rule depends on original file path to create the destination path like:
/foo/bar/test_snakecase/my_script.php -> /src/Controller/Legacy/TestSnakecase/MyScriptController.php
The problem is, \Rector\Testing\PHPUnit\AbstractRectorTestCase::doTestFileInfo uses StaticFixtureSplitter::splitFileInfoToLocalInputAndExpectedFileInfos which creates files in the temp directory. The part of the original path (i. e. test_snakecase) is lost.
What can I do to solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions