开发者

phpunit and autoloader [closed]

开发者 https://www.devze.com 2022-12-22 09:29 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

I'm trying to use autoloader with phpunit this way:

  • in phpunit.xml I put bootstrap="bootstrap.php"
  • in bootstrap.php I put

    define( 'TESTING', true );
    putenv( 'APPLICATION_ENV=testing' );
    
    
    function __autoload($className) {    
        include_once __autoloadFilename($className);
    }
    
    
    function __autoloa开发者_StackOverflow社区dFilename($className) {
        return str_replace('_','/',$className).".php";
    }
    

When trying to run phpunit command i get error:

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

Thank you for any help.

0

精彩评论

暂无评论...
验证码 换一张
取 消