phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

PHPUnit problem

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.

PHPUnit problem

Postby Erik Frèrejean » Thu Aug 11, 2011 3:11 pm

I need a little help with PHPUnit, I've got it installed and running but when running phpBB database tests it errors out:
Code: Select all
 [erikfrerejean@ ../gitrepositories/Ascraeus]$ phpunit
PHPUnit 3.5.14 by Sebastian Bergmann.

I............................................................   61 / 1178 (  5%)
.............................................PHP Fatal error:  phpunit_autoload(): Failed opening required '/usr/lib/php/PHPUnit/Extensions/Database/Operation/Exception.php' (include_path='.:/usr/lib/php:/usr/local/PEAR:/php/includes:/usr/lib/php/PHPUnit') in /usr/lib/php/PHPUnit/Autoload.php on line 56

Fatal error: phpunit_autoload(): Failed opening required '/usr/lib/php/PHPUnit/Extensions/Database/Operation/Exception.php' (include_path='.:/usr/lib/php:/usr/local/PEAR:/php/includes:/usr/lib/php/PHPUnit') in /usr/lib/php/PHPUnit/Autoload.php on line 56

I've checked the file and also the include_path in php.ini
Code: Select all
 783 ; UNIX: "/path1:/path2"
 784 include_path = ".:/usr/lib/php:/usr/local/PEAR:/php/includes"

based upon the PHPUnit autoloader this should be correct, does phpBB use PHPUnit with some kind of twist or am I missing something here?
Available on .com
Support Toolkit developer
User avatar
Erik Frèrejean
Registered User
 
Posts: 207
Joined: Thu Oct 25, 2007 2:25 pm
Location: surfnet

Re: PHPUnit problem

Postby igorw » Thu Aug 11, 2011 7:57 pm

I had this problem too, not sure if it is OSX specific. Try re-installing phpunit and dbunit. If that doesn't fix it, try re-installing pear using go-pear.phar.
User avatar
igorw
Registered User
 
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: PHPUnit problem

Postby Erik Frèrejean » Wed Aug 17, 2011 12:12 pm

Thanks for the tip :).
Available on .com
Support Toolkit developer
User avatar
Erik Frèrejean
Registered User
 
Posts: 207
Joined: Thu Oct 25, 2007 2:25 pm
Location: surfnet

Re: PHPUnit problem

Postby callumacrae » Fri Aug 19, 2011 4:05 pm

I'm having trouble now (almost the same error)

callum-mbp:phpbb3 callumacrae$ phpunit
PHPUnit 3.5.15 by Sebastian Bergmann.

............................................................... 63 / 944 ( 6%)
.................................
Fatal error: phpunit_autoload(): Failed opening required '/Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Operation/Exception.php' (include_path='.:/Users/callumacrae/pear/share/pear') in /Users/callumacrae/pear/share/pear/PHPUnit/Autoload.php on line 56


I've reinstalled phpunit and dbunit several times, and also pear. The file mentioned exists and is readable. Any ideas?
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: PHPUnit problem

Postby Oleg » Sat Aug 20, 2011 7:13 am

Readable by the user you use for running tests, or some other user?

Make sure the entire tree leading up to that file is readable.

Can you physically read that file as the user running the tests?

Also, note that phpunit has a bunch of dependencies on other packages. It does not just depend on dbunit (at least officially).

You can try installing and enabling xdebug and getting a stack trace to see what code calls that include, and maybe add some debug prints there.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: PHPUnit problem

Postby callumacrae » Sat Aug 20, 2011 12:51 pm

Oleg wrote:Readable by the user you use for running tests, or some other user?


Same account. Also doesn't work when running PHPUnit as sudo (don't shoot me please)

Oleg wrote:Make sure the entire tree leading up to that file is readable.


It is.

Oleg wrote:Can you physically read that file as the user running the tests?


Yes.

Oleg wrote:Also, note that phpunit has a bunch of dependencies on other packages. It does not just depend on dbunit (at least officially).

You can try installing and enabling xdebug and getting a stack trace to see what code calls that include, and maybe add some debug prints there.

I've got xdebug, I just don't know how to use it :-(

~Callum
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: PHPUnit problem

Postby naderman » Sun Aug 21, 2011 7:06 pm

This really looks like you are just missing DbUnit because of a botched PHPUnit update. See http://sebastian-bergmann.de/archives/8 ... -Woes.html

So you should run

Code: Select all
pear install -f phpunit/DbUnit
pear install -f phpunit/PHPUnit_MockObject
pear install -f phpunit/PHPUnit_Selenium


And then you should really upgrade your pear.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: PHPUnit problem

Postby callumacrae » Sun Aug 21, 2011 10:34 pm

naderman wrote:This really looks like you are just missing DbUnit because of a botched PHPUnit update. See http://sebastian-bergmann.de/archives/8 ... -Woes.html

So you should run

Code: Select all
pear install -f phpunit/DbUnit
pear install -f phpunit/PHPUnit_MockObject
pear install -f phpunit/PHPUnit_Selenium

Surely if that was the case, the file wouldn't exist? Running those commands hasn't fixed it.

naderman wrote:And then you should really upgrade your pear.

I installed pear yesterday using go-pear.phar off their website. What's the latest version? I'm running 1.9.4
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 882
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: PHPUnit problem

Postby naderman » Sun Aug 21, 2011 10:43 pm

Well that was under the assumption that the forced installs would fix it. Since that wasn't the problem, you're pear version is probably up to date ;-)
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: PHPUnit problem

Postby Oleg » Mon Aug 22, 2011 12:50 am

That really should not happen. phpunit checks for file existence immediately before requiring the file.

You can try:

1. ls -l /Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Operation/Exception.php

2. Replace require_once with include_once on line 56. See what php says about that.

3. Try requiring that file in php code yourself, see what happens.

4. Install a different version of phpunit.

5. Do you have anything like selinux running?

6. Copy all pear files into the current directory (/Users/callumacrae/pear/share/pear/ -> .), without preserving permissions.

For xdebug start here: http://xdebug.org/docs/stack_trace
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Next

Return to General Development Discussion

Who is online

Users browsing this forum: No registered users and 8 guests