【问题标题】:phpunit is not workingphpunit 不工作
【发布时间】:2011-12-11 13:15:32
【问题描述】:

我正在尝试让 phpunit 在我的 ubuntu 11.10 安装上工作。 我已经按照here 的建议使用 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 时,我仍然一无所获!

有什么想法吗??

【问题讨论】:

    标签: php ubuntu phpunit pear


    【解决方案1】:

    我刚刚想通了...我忘记在 php.ini 的 include_path 中添加 /usr/share/php。呜呜呜……

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-21
      • 1970-01-01
      • 1970-01-01
      • 2013-07-30
      • 1970-01-01
      • 1970-01-01
      • 2014-07-27
      • 2016-04-08
      相关资源
      最近更新 更多