phpmd icon indicating copy to clipboard operation
phpmd copied to clipboard

Improve on testing classes as a lib

Open chr0n1x opened this issue 11 years ago • 2 comments

I have my own set of rules in a personal repository. Via composer, vendor/bin/phpmd picks them up seamlessly which is really cool!

However, I've started toying with the idea of testing my rules by extending AbstractTest and have run into a few problems. The main problem seems to be that AbstractTest is not very flexible. Specifically, createResourceUriForTest makes a lot of assumptions as to where the resources files are.

Is there a way to point the tests at some other resource file directory in my repo? Instead of having that method assume that all file resources are in vendor/phpmd/phpmd/src/test/resources/files/<PATH_TO_RULES>?

chr0n1x avatar Jan 12 '15 20:01 chr0n1x

Feel free to provide a PR that improves the flexibility of the testing suite.

ravage84 avatar Jun 27 '16 12:06 ravage84

createResourceUriForTest is not a private function you can rewrite it in your test and set path to file what you need

sveneld avatar Apr 02 '20 17:04 sveneld