Mac OSX 10.8上的PHPUnit错误

时间:2013-01-13 22:13:23

标签: php phpunit

我正在尝试学习一些关于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

其他人遇到这些问题吗?

0 个答案:

没有答案