PHPUnit无法工作。

3

我想让phpunit在我的ubuntu 11.10安装中工作。 我已经按照这里的建议使用PEAR安装了PHPUnit,然后我准备了一个非常小的测试类:

error_reporting(E_ALL & ~E_DEPRECATED);
set_include_path(get_include_path().':/usr/share/php');
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Extensions/OutputTestCase.php';

class ExampleTest extends PHPUnit_Framework_TestCase
{
    public function testOne()
    {
        $this->assertTrue(FALSE);
    }
}
// $suite = new PHPUnit_Framework_TestSuite('ExampleTest');
// PHPUnit_TextUI_TestRunner::run($suite);

当我通过命令行可执行文件phpunit运行时,什么也没有显示。 当我取消注释最后两行代码并使用php可执行文件运行该文件时,我得到了正确的输出(失败断言是真实的等等)。
此外,当我尝试运行“phpunit --version”时,还是没有任何显示!
有什么想法吗?
1个回答

2

我刚刚弄清楚了……我忘记在php.ini中的include_path中添加/usr/share/php。真是气死我了……


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接