所以我已经通过PEAR安装了PHP单元(所有文件都在那里,我已经检查过了)。然而,当我尝试运行测试时,我会得到:
Warning: require_once(PHPUnit/Framework.php) [function.require-once]: failed to open stream: No such file or directory in C:'WAMP'www'ExampleTests'arraytest.php on line 2
我猜这与我的PHPUnit安装没有正确更新include_path有关,但我不太确定该更新到什么?
我在Windows(7)上,使用WAMP。
干杯!
编辑:PHP.ini底部包含:
;***** Added by go-pear
include_path=".;C:'WAMP'bin'php'php5.3.10'pear"
;*****
我也得到错误:
Fatal error: require_once() [function.require]: Failed opening required 'PHPUnit/Framework.php' (include_path='.;C:'php'pear')
然而,在PHP.ini中查看后,没有指向C:''PHP''pear的include路径?
PHPUnit 3.6+不提供PHPUnit/Framework.php
,您不需要在测试中要求它来使PHPUnit工作。
只要删除require调用就可以了。