如何创建到PHPUnit的符号链接? [英] How to create a Symbolic link to PHPUnit?

查看:90
本文介绍了如何创建到PHPUnit的符号链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel.每当我需要运行测试时,都必须在以下目录中执行PHPUnit:

I'm using Laravel. Whenever I need to run the tests I have to execute PHPUnit in the following directory:

vendor/phpunit/phpunit/phpunit

如何创建到上面文件的符号链接,这样我不必每次都输入phpunit的完整路径?

How can I create a symlink to the file above so that I don't have to type in the full path to phpunit every time ?

我尝试了以下命令,但是没有用:

I tried the following command but didn't work:

ln -s vendor/phpunit/phpunit/phpunit mysym 

由于某种原因,当我尝试执行Symlink时,它显示找不到命令".

For some reason, it says 'Command Not Found' when I try to execute the Symlink.

推荐答案

如何创建到上面文件的符号链接,这样我就不必每次都输入phpunit的完整路径?

How can I create a symlink to the file above so that I don't have to type in the full path to phpunit every time ?

您没有做任何符号链接.相反,您需要将该路径添加到您的$PATH变量中.此外,您应该使用vendor/bin文件夹,而不是直接使用软件包的文件夹.

You don't do any symlinks. Instead you need to add that path to your $PATH variable. Additionally, you should use vendor/bin folder, not the package's folders directly.

因此,在您的shell中执行以下操作:

So in your shell do:

$ export PATH=$PATH:/home/you/project/vendor/bin/

您也可以将其添加到.bashrc.

这篇关于如何创建到PHPUnit的符号链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆