Yii Framework Forum: [Solved] Unit test can't find File/Iterator - Yii Framework Forum

Jump to content

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

[Solved] Unit test can't find File/Iterator ...and it worked before... what changed?

#1 User is offline   andrewzboard 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 10-February 12

Posted 22 February 2012 - 02:29 PM

Hi all,

I'm working my way through this useful book. This is the first problem I haven't been able to solve via web searching.

Got PHPUnit and Selenium installed and successfully ran unit tests in Chapter 3 for the demo project. But trying the trackstar unit test failed. And going back to the demo unit test, it failed also, with the same message:


amd @ /Library/WebServer/Documents/demo/protected/tests: phpunit unit/MessageTest.php

Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/lib/php/PHPUnit/Autoload.php on line 45

Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:') in /usr/lib/php/PHPUnit/Autoload.php on line 45

Now... what changed? I did make a change in php.ini, but I *swear* (famous last words) that I reverted. And then rebooted.


The "missing" file is definitely at /usr/lib/php/File/Iterator/Autoload.php. That include path in the error message looks suspiciously scant. Fix? Thanks for any tips.

AD
0

#2 User is offline   andrewzboard 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 10-February 12

Posted 22 February 2012 - 05:20 PM

FWIW, the environment PATH as reported by phpinfo() is "/usr/bin:/bin:/usr/sbin:/sbin".
0

#3 User is offline   andrewzboard 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 10-February 12

Posted 24 February 2012 - 02:53 PM

Solution: edit the /etc/php.ini file and change the include_path entry from

include_path = ".:/php/includes"

to

include_path = ".:/php/includes:/usr/lib/php"

Now why this wasn't needed for earlier unit tests is a mystery. I think that PHP was getting its ini values not from /etc/php.ini.default (which already existed and also omitted the path I added) but from somewhere else. And then something I did convinced PHP to start using the .ini.default file. I edited it and then copied to plain old .ini file and searching for the File/ directory now succeeded.

AMD
0

#4 User is offline   oxo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 16-March 12

Posted 16 March 2012 - 04:02 PM

I solved this problem by adding the following include path to my php.ini files, both under the main php directory and apache;

include_path = ".;C:\wamp\bin\php\php5.3.8\pear"
0

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