0

我正在尝试学习一些关于 PHPUnit 测试的知识,并且我通过 PEAR 安装了 PHPUnit,但是我没有运气尝试让它运行。

这是我的脚本:

<?php
    require_once "PHPUnit.php";
    class myclass_test extends PHPUnit_TestCase {
        protected $my;

        function setUp() {
            $this->$my = new Myclass('xxx', 'xxx', 'xxx');
        }

        function teardown() {
            unset($this->my);
        }

        function testResponseCodeSuccess() {
            self::assertTrue($this->my->_validResponseCode(200));
        }
    }

我在控制台上运行它:php myclass_test.php

我收到这些错误:

PHP Warning:  require_once(PHPUnit.php): failed to open stream: No such file or directory in /Users/dennismonsewicz/Projects/PHP/test-php/tests/myclass_test.php on line 2
PHP Fatal error:  require_once(): Failed opening required 'PHPUnit.php' (include_path='.:/Users/dennismonsewicz/pear/share/pear:/usr/local/share/pear:/usr/bin/pear') in /Users/dennismonsewicz/Projects/PHP/test-php/tests/myclass_test.php on line 2

我遵循了本教程: http: //pear.php.net/manual/en/package.php.phpunit.intro.php

还有其他人遇到这些问题吗?

4

0 回答 0