3

我正在尝试以这种方式将自动加载器与 phpunit 一起使用:

  • 在 phpunit.xml 我把bootstrap="bootstrap.php"
  • 在 bootstrap.php 我把

    define( 'TESTING', true );
    putenv( 'APPLICATION_ENV=testing' );
    
    
    function __autoload($className) {    
        include_once __autoloadFilename($className);
    }
    
    
    function __autoloadFilename($className) {
        return str_replace('_','/',$className).".php";
    }
    

尝试运行 phpunit 命令时出现错误:

Generating code coverage report, this may take a moment.
Fatal error: Method PEAR_Autoloader::__call() must take exactly 2 arguments in /usr/share/php/PEAR/Autoloader.php on line 211

感谢您的任何帮助。

4

0 回答 0