如何让phpunit在cloud9 IDE中运行?

时间:2015-12-16 18:19:08

标签: laravel phpunit laravel-5.1 cloud9-ide

刚开始在cloud9 IDE上开展laravel项目,但我无法让phpunit工作。每次运行PHPUnit命令时,我都会得到一个

  找不到

命令

响应。从项目中的文件结构我可以看到phpunit文件。我以前从未使用过云9作为laravel项目所以我无法确定它是否应该如何表现。有没有人之前在cloud9上成功使用过phpunit?

1 个答案:

答案 0 :(得分:4)

您可以使用composer全局安装phpunit(在默认的C9工作区中可用)。 Phpunit 4.8。*适用于PHP 5.5。

RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]

RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* ? [F,L]

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([0-9a-z-]+)$ index.php?product=$1 [NC,L]

phpunit可执行文件将安装在sudo composer global require phpunit/phpunit:4.8.* 中,因此请在~/.composer/vendor/bin/文件末尾添加以下行,以便在其他位置使用该命令。

~/.profile

之后运行export PATH=~/.composer/vendor/bin:$PATH 注册新路径,然后在Laravel安装文件夹中运行source ~/.profile