0

I am looking for a way to run static tests for a single module as my application is huge. So running static tests frequently and checking code consumes a lot of time.

As per my knowledge, Magento currently provides only unit tests on module level.

Let me know if there is any way to achieve this.

0

Yes, there is a way to run custom testsuite according to your needs. Static tests are run with phpunit and the configuration file is in dev/tests/static/phpunit.xml.dist

So, from inside of this path do:

  1. cp phpunit.xml.dist phpunit.xml
  2. Edit new file with your editor and create custom testsuite in element. You can read more about configuring phpunit with a file in documentation
  3. When you create your testsuite enter command php ../../../vendor/bin/phpunit --testsuite="YOUR TESTSUITE NAME"

Reference

  • Getting this message while running command - "No tests executed!" Let me know if I am doing anything wrong. – Sanjay Chaudhary Jul 15 '19 at 9:16
  • @SanjayChaudhary refer this link it would be helpful. – Mohit Rane Jul 15 '19 at 9:21
  • Still not getting How I should configure it to work. Tried all the possibilities. – Sanjay Chaudhary Jul 15 '19 at 9:38
  • is this link stackoverflow.com/questions/29299206/… relevant to you? – Mohit Rane Jul 15 '19 at 9:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.