I began to learn how to use PHPUnit. However, I ran into a problem that I don’t know how to solve.
I have a folder with a name lessonsand inside there is composer.jsonone with which I installed PHPUnit. The output was a folder with a name vendorand a subfolder with a name binin which there is a phpunit file.
As cmdI typed: cd c:/xampp/htdocs/lessons/vendor/bin. Now the cmd folder is installed in the same folder as phpunit. I created a directory in lessonswhich I called tests( lessons/tests), which stores all my tests. I created a file with a name PracticeTest.phpwith a very simple test script in it,
When I get back to cmdand dial phpunit tests, I get cannot open file tests.php. When I try to enter phpunit PracticeTest, I get cannot open file PracticeTest.php. When I try phpunit tests/PracticeTest(with .phpor without), I get the same error that the file cannot be opened.
My suspicion is that this has something to do with the person who cmdpoints to the directory lessons/vendor/bin, but I'm not sure if this is really a problem or how to fix it.
to arrange the paths:
lessons\vendor\bin\lessons\tests\lessons\tests\PracticeTest.php
Thanks in advance!
source
share