Phpunit with a broken composer

Background: I am on a Windows host and sshing to configure LAMP for strollers (ubuntu 13.04).

I installed phpunit with composer using the following line in my composer.json:

"require-dev": { "phpunit/phpunit": "3.7.*" } 

Then I ran an update for the linker that installed phpunit. Now I can go to / vendor / bin and see the phpunit binary.

However, if I find phpunit from within this directory (or somewhere where elese is), I get the error message "phpunit is not installed"

Any suggestions as to where I am going next are so few steps in this setup, I really can't see where I could go wrong

+4
source share
3 answers

./phpunit from the bin directory.

It is just not in your way.

+3
source

So, I also had this problem, a change in my stray file was fixed for me:

config.vm.synced_folder "C:/dev/vm/share", "/var/www/", mount_options: ['dmode=777','fmode=666']

to

config.vm.synced_folder "C:/dev/vm/share", "/var/www/", mount_options: ['dmode=777','fmode=777']

There are many tips saying that 666 is permissible, but in my case it is not, and since it is only a development machine, the security implications are not very important.

+5
source

I created the script above:

 #!/bin/bash binary=$1 shift dir=$PWD for i in $( seq 5 ) do if [ -e "$dir/composer.json" ] then $dir/vendor/bin/$binary $@ else echo "not found phpunit in $dir" fi dir="$dir/.." done 

If you name it "composer.exec" and put it in your path, you can name it:

 composer.exec phpunit [phpunit-options] 

And there is! Call phpunit or any other bin contained in the / bin provider.

0
source

Source: https://habr.com/ru/post/1494262/


All Articles