2

I am stuck with an issue in which i cant run my test cases. I have a laravel project where I wrote the test cases and tried to run from my homestead server. but it shows error.

" vendor/bin/phpunit: line 1: ../phpunit/phpunit/phpunit: No such file or directory"

I have phpunit in my vendor file.

Anyone else has faced such issue, Why this error is showing up?

Waiting for a response..

4
  • 1
    can please show me your vendor/bin/phpunit file code Commented Feb 26, 2019 at 7:53
  • Can you write what you did to run phpunit? Commented Feb 26, 2019 at 8:17
  • vendor/bin/phpunit file contains " ../phpunit/phpunit/phpunit ". Only this single line Commented Feb 26, 2019 at 8:25
  • I wanted to run all my unit cases, so just used phpunit command in the command line Commented Feb 26, 2019 at 8:26

2 Answers 2

5

I think you have the wrong configuration in vendor/bin/phpunit file

First of all, I suggest delete phpunit file under in vendor/bin/phpunit

After, in your composer.json file add this:

"require-dev": {
    "phpunit/phpunit": "^5.0"
},

After, run this command on your command prompt: composer update

They will create a new phpunit file and all related configurations, here the vendor/bin/phpunit will be placed

Sign up to request clarification or add additional context in comments.

Comments

0

Try below command in command line-

vendor/bin/phpunit

This will load your phpunit.xml file. Otherwise it cannot load your configuration file. Unless if you don't give spesific path:

vendor/bin/phpunit --configuration /path/to/laravels/phpunit.xml

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.