简体   繁体   中英

How do I run unit tests stored in my application directory as opposed to in the PHP directory?

I've just installed PHPUnit and wrote a quick class which I saved to C:\\PHP and it worked fine. If however I move the php file containing the test class to the tests directory of my application, it returns the error Class firstTest could not be found in ..

How do I resolve the problem such that it can see the class in the application test directory?

检查您的配置文件,并确保已给出测试目录的正确路径。

Thanks for the response - it wasn't the solution I used, but it led me to research that produced an alternative.

What I did was to add my PHP directory (C:\\PHP) to the PATH environment variable. This allowed me to call phpunit from the tests directory of my application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM