Yii Framework Forum: PHPUnit error PHPUnit_Util_Filter::addFileToFilter() - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHPUnit error PHPUnit_Util_Filter::addFileToFilter() in /usr/share/php/PHPUnit/Framework.php on line 48

#1 User is offline   donPi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 13-March 12

Posted 14 July 2012 - 08:34 AM

Hi guys, I'm trying to install and use phpunit and selenium, but after installation and apache restart, when I run the test suggested in the Yii guide (functional/SiteTest.php), I've this output.

:$ phpunit functional/SiteTest.php 
PHP Fatal error:  Call to undefined method PHPUnit_Util_Filter::addFileToFilter() in /usr/share/php/PHPUnit/Framework.php on line 48
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130
PHP   4. PHPUnit_TextUI_Command->handleArguments() /usr/share/php/PHPUnit/TextUI/Command.php:139
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() /usr/share/php/PHPUnit/TextUI/Command.php:620
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/php/PHPUnit/TextUI/Command.php:867
PHP   7. PHPUnit_Util_Fileloader::load() /usr/share/php/PHPUnit/Util/Fileloader.php:79
PHP   8. include_once() /usr/share/php/PHPUnit/Util/Fileloader.php:95
PHP   9. require_once() /home/croxarens/Desktop/www/test-yii/protected/tests/bootstrap.php:8
PHP  10. YiiBase::autoload() /home/croxarens/Desktop/www/yii/framework/YiiBase.php:0
PHP  11. include() /home/croxarens/Desktop/www/yii/framework/YiiBase.php:397
PHP  12. require_once() /home/croxarens/Desktop/www/yii/framework/test/CWebTestCase.php:11
PHP  13. require_once() /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php:46

How should I fix the problem?

Thx in advance for any help!

#2 User is offline   zeroByte 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 17-February 12

Posted 16 July 2012 - 05:07 AM


I had this error too - as far as I remember, this is due to different versions of components of PHPUnit. I uninstalled PHPUnit and did something like this:


pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com

pear update-channels

pear install --alldeps phpunit/PHPUnit


Share this topic:

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users