如何在Xampp中配置PhpUnit?

发布于 2024-10-11 07:23:21 字数 724 浏览 3 评论 0原文

我已经在 Xampp 中成功安装了 PhpUnit,现在我需要配置它,我需要从文档中执行以下步骤:

2. Prepare the phpunit script:
   1.
      Rename the phpunit.php script to phpunit.
   2.
      Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).
   3.
      Copy it to a directory that is in your path and make it executable (chmod +x phpunit).


3. Prepare the PHPUnit/Util/PHP.php script:
   1.
      Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).

我在 PEAR 目录中找不到 phpunit.php。有关此文件在 PhpUnit 的 Xampp 安装中的位置的任何线索吗?有什么线索吗?

最好的问候,


Update1:

​​我已经通过 PEAR 安装了它。好的,我看看是否有效。

此致,

I have successfully installed PhpUnit in Xampp, now I need to configure it, i need to take this steps from the documentation:

2. Prepare the phpunit script:
   1.
      Rename the phpunit.php script to phpunit.
   2.
      Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).
   3.
      Copy it to a directory that is in your path and make it executable (chmod +x phpunit).


3. Prepare the PHPUnit/Util/PHP.php script:
   1.
      Replace the @php_bin@ string in it with the path to your PHP command-line interpreter (usually /usr/bin/php).

I can't find phpunit.php in the PEAR directory. Any clues on where is this file on a Xampp installation of PhpUnit? Any clues?

Best Regards,


Update1:

I have install it via PEAR. Ok, I will see if that work.

Best Regards,

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

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

发布评论

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

评论(2

雨后咖啡店 2024-10-18 07:23:21

你是怎么安装的?如果您使用 Xampp 附带的 pear 安装程序,它应该可以正常工作。

/opt/lampp/bin/pear channel-discover pear.phpunit.de
/opt/lampp/bin/pear install phpunit/PHPUnit

然后可执行文件应驻留在 /opt/lampp/bin/phpunit 中。

如果您以其他方式安装它(处理文件?抱歉,我在 xampp 文档中没有找到其他提示),那么只需将其指向我,我将编辑答案

How did you install it ? If you use the pear installer that is shipped with Xampp it should just work.

/opt/lampp/bin/pear channel-discover pear.phpunit.de
/opt/lampp/bin/pear install phpunit/PHPUnit

and the executable should then reside in /opt/lampp/bin/phpunit.

If you installed it in another way (coping the files ?, sry i didn't find other hints in the xampp docs) then just point me to it and i will edit the answer

梦途 2024-10-18 07:23:21

我尝试对安装 phpunit 的所有必要/有用命令进行总结。我希望这仍然可以帮助一些偶然发现这一点的人。

请注意,最好以管理员身份运行所有命令。

php go-pear.phar
pear clear-cache 
pear update-channels
pear upgrade --alldeps -f 
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear channel-discover components.ez.no
pear config-set preferred_state beta
pear install --onlyreqdeps phpunit/PHPUnit

祝你好运,
阳光明媚

I tried to make a summary of all necessary / useful commands to install phpunit. I hope this still might help some people, who stumble upon this.

Note that it is best, to run all commands as administrator.

php go-pear.phar
pear clear-cache 
pear update-channels
pear upgrade --alldeps -f 
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear channel-discover components.ez.no
pear config-set preferred_state beta
pear install --onlyreqdeps phpunit/PHPUnit

Good Luck,
Sunny

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