A
A
Adil Akavov2016-03-12 11:54:26
Perl
Adil Akavov, 2016-03-12 11:54:26

Trouble with the basics of unit testing?

Dear forum visitors, please help.
I just started learning the basics of unit testing in phpunit. In this regard, the following question arose: I have a userauth class that is located at the following path D:\work\GitHub\api\test\unit\Security\Authentication part of this class is covered by unit tests and part is not, my task is to check the percentage of coverage class tests. I do this, I go to the root of the project, the path is D:\work\GitHub\api, I call git bush in it, with it I go to the directory where the userauth class itself is located via the cd command, then I call $ phpunit --coverage-html in the class folder. /logs/report/ while the second parameter is the folder in which I want the report to be saved the path to the folder is the following d:/work/GitHub/api/logs/report/ with these parameters phpunit shows me help information about what commands are in phpunit , At the same time, the report files in the folder that I specify are not observed. What am I doing wrong tell me

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maronus, 2016-03-14
@Maronus

First: you run the command phpunit --coverage-html PATHin the folder with the class you are trying to test. This is not true. You need to run this command in the folder that contains the unit tests themselves.
Second: when

phpunit shows me help information about what commands are in phpunit
Above this text, the reason for the error is displayed.
Thirdly, it is not necessary to open Git Bash in the project folder. No one bothers you to open it from the start menu, and open the desired directory via cd.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question