gpt4 book ai didi

zend-framework - Zend Framework (PHPUnit) 测试无法运行 (phpunit : command not found/Class 'PHPUnit_Framework_TestCase' not found)

转载 作者:行者123 更新时间:2023-12-04 12:13:53 26 4
gpt4 key购买 nike

我按书安装了 PHPUnit:

sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit

包含路径添加在 /etc/php5/cli/php.ini
include_path = ".:/usr/share/php"

$ ls /usr/share/php/PHPUnit/
Extensions Framework

但是现在,如果我想运行 Zend Framework 的测试
user@server:/var/www/page/tests$ ./runtests.sh 
+ phpunit --verbose AllTests
./runtests.sh: line 72: phpunit: command not found
user@server:/var/www/page/tests$ php AllTests.php
PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/page/tests/Zend/Acl/AclTest.php on line 37

当然我也得到了 phpunit: command not found当我尝试按照 PHPUnit 手册 http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html 中的说明进行操作时Zend 框架上下文之外。

我感觉我在这里缺少一些重要的东西......

已解决

看起来 PEAR channel 有问题,再次添加其他 2 个之后,它起作用了:
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com

最佳答案

既然问题已经在评论中解决了,我就做一个真实的答案来总结一下。

问题的原因是缺少 phpunit 命令。重新安装 phpunit 并将变量 PATH 设置为包含 phpunit 命令 ( export PATH=$PATH:/path/to/folder/with/phpunit ) 的文件夹解决了该问题。

关于zend-framework - Zend Framework (PHPUnit) 测试无法运行 (phpunit : command not found/Class 'PHPUnit_Framework_TestCase' not found),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4804147/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com