【发布时间】:2012-01-31 19:21:22
【问题描述】:
当我尝试在 phpunit 中运行 testclass 时出现此错误。
C:\xampp\htdocs\unittest>phpunit UnitTest usertest.php
PHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream No such file or directory in C:\xampp\php\pear\PHPUnit\Autoload.php on line 45
PHP Stack trace:
PHP 1. {main}() C:\xampp\php\phpunit:0
PHP 2. require() C:\xampp\php\phpunit:41
Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in C:\xampp\php\pear\PHPUnit\Autoload.php on line 45
Call Stack:
0.0004 325352 1. {main}() C:\xampp\php\phpunit:0
0.0026 366520 2. require('C:\xampp\php\pear\PHPUnit\Autoload.php')xampp\php\phpunit:41
PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.;C:\php\pear') in C:\xampp\php\pear\PHPUnit\Autoload.php on line 45
PHP Stack trace:
PHP 1. {main}() C:\xampp\php\phpunit:0'
谁能解决这个问题??
注意:我使用的是 Windows 7。
谢谢,
【问题讨论】:
-
(note) 据我所知,这不是重复的,因为它是安装问题,可能是 SF 迁移,但这是一个真正的问题 :)
-
也遇到了类似的错误。如果您使用作曲家,可以简单地解决这个问题,请确保您拥有最新的稳定版本的 PHPUnit,例如5.5,一切都会工作。
标签: php unit-testing phpunit