Creating a base test-class for PHPUnit and extending it for common functionality results in class not found error

前端 未结 4 1428
南方客
南方客 2021-02-06 22:44

I\'m running PHPUnit using a bootstrap file for autoloading classes (generated by composer).

All my tests load up classes just fine, but for two of my tests, I made a \

4条回答
  •  半阙折子戏
    2021-02-06 23:22

    For me the solution was much simpler.

    1. I changed the capital letter of Test to test at the end of the file and the class name

    BaseSomethingtest.php

    1. I just put a word at the end of my base class. As far as it didn't finish with Test, phpunit didn't call it

    BaseSomethingTestCase.php

提交回复
热议问题