Answer the question
In order to leave comments, you need to log in
How to properly connect PHPUnit?
Hello. I installed PHPUnit via Composer, but the command "vendor\bin\phpunit tests" does not work - "vendor is not recognized as an internal..." Only if I go to the bin folder, I can work with phpunit, which I did. I saw that there is a bat file in this folder, I copied it to the root and changed the path to "vendor/phpunit/phpunit/phpunit". Now everything works from the project root. Does this option take place or should it be better to register a variable in PATH or install PHPUnit globally right away?
Answer the question
In order to leave comments, you need to log in
First, you can add to composer.json:
"config": {
"bin-dir": "bin"
}
<phpunit bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Unit test">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
bin/phpunit
, tests will be launched with the settings specified in the config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question