PHPUnit 在哪里?

发布于 2024-11-15 20:59:57 字数 983 浏览 2 评论 0原文

已解决!

我从 pear 中卸载了 phpunit,然后再次重新安装。我相信在安装之前我使用了错误/旧/不足的源。效果就像一个魅力!


所以我正在尝试设置 PEAR & PHPUnit。我正在关注 http://www.newmediacampaigns。 com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard 但在我安装了 pear 之后,我在 /usr/local 中有一个不同的目录结构。无论如何,我能够运行 phpunit 安装。但现在我迷路了,在弄出更大的混乱之前寻求帮助:)

pear config-show 说:

PEAR directory                 php_dir          /usr/local/share/pear

而我的 php.ini 文件(并在 phpinfo() 中确认)说:

include_path=".:/usr/local/share/pear"

所以这很好,对吧?但现在怎么办?我得到

无法打开所需的“PHPUnit/Framework.php”(include_path='.:/usr/local/share/pear')

如果我尝试将其包含在 php.ini 文件中, 我不知道二进制文件可能在哪里从命令行运行它。

/usr/local/share/pear/PHPUnit 内部有两个目录 "Extensions""Framework"

Resolved!

I uninstalled phpunit from pear and then reinstalled it again. I believe I was using the wrong/old/not enough sources before installing. Works like a charm!


So I'm trying to set up PEAR & PHPUnit. I was following http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard but after I installed pear I had a different directory structure in /usr/local. Regardless, I was able run the phpunit install. But now I'm lost and asking for help before I make a bigger mess :)

pear config-show says:

PEAR directory                 php_dir          /usr/local/share/pear

And my php.ini file (and confirmed in phpinfo() says:

include_path=".:/usr/local/share/pear"

So that's good, right? But now what? I get

Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/local/share/pear')

If I try to include it in the php. And I have no idea where the binary might be to run it from the command line.

Inside /usr/local/share/pear/PHPUnit there are two directories "Extensions" and "Framework"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑着哭最痛 2024-11-22 20:59:57

有时会发生安装在 PHPUnit 上失败的情况,但在依赖项上安装成功,因此它只是看起来安装成功。

安装时尝试此

pear install --force --alldeps phpunit/PHPUnit

--force 选项将强制安装 PHPUnit,即使无法满足​​所有依赖项。就我而言,尽管可以使用 PHP_Invoker 包,但 dom PHP 扩展缺少依赖项,这会阻止安装。

--alldeps 选项可确保安装所有依赖项。

It sometimes happen that the install fails on PHPUnit specifically, but succeeds on the dependencies, so it only looks like the install was succesfull.

Try this when installing

pear install --force --alldeps phpunit/PHPUnit

The --force option will force the install of PHPUnit, even if all the dependencies can't be met. In my case there was a missing dependency for the dom PHP extension which blocked the installation even though the PHP_Invoker package could be used instead.

The --alldeps option makes sure that all of the dependencies got installed.

断爱 2024-11-22 20:59:57

检查 pear 安装中的 bin 目录,类似于 /usr/local/share/pear/bin/ - 您的安装与我的不同。

您也可以尝试搜索二进制文件-

find /usr/local/share/pear -name 'phpunit'

Check for a bin directory in the pear install, something along the lines of /usr/local/share/pear/bin/ - your install is different than mine..

You could also try searching for the binary -

find /usr/local/share/pear -name 'phpunit'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文