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.

Re: PHPUnit problem

Postby callumacrae » Mon Aug 22, 2011 8:34 am

Oleg wrote: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


Yup, works. Permissions are 644.

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

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

I............................................................ 61 / 1176 ( 5%)
.............................................EEEEEEEEEEEEEEEE 122 / 1176 ( 10%)
EEEEEEEEEEEEEEEEEEEEEE....................................... 183 / 1176 ( 15%)
.............................................EEEEEEEEEEEEEEEE 244 / 1176 ( 20%)
EEEEEEEEEEE


Pretty sure that isn't right.

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

That works fine.

Oleg wrote:4. Install a different version of phpunit.

How?

Oleg wrote:5. Do you have anything like selinux running?

No

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

Will try that if installing a different version doesn't work.


Thanks :-)
"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 ledzef » Fri Nov 11, 2011 4:39 am

it works for me too. It fixes some other errors. Thanks for the tip though. :D
User avatar
ledzef
Registered User
 
Posts: 4
Joined: Fri Nov 11, 2011 1:27 am

Re: PHPUnit problem

Postby callumacrae » Sat Apr 07, 2012 12:09 pm

Bump. Still haven't managed to fix it.

I've reinstalled several times, made sure that everything is readable, confirmed that it is in the include_path.

The error:
callum-imac:phpbb3 callumacrae$ phpunit
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /Applications/XAMPP/xamppfiles/htdocs/phpbb-github/phpbb3/phpunit.xml.dist

............................................................. 61 / 1036 ( 5%)
.............................PHP Fatal error: phpunit_dbunit_autoload(): Failed opening required '/Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Operation/Exception.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear:/usr/share/pear:/Users/callumacrae/pear/share/pear') in /Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Autoload.php on line 161


Line 161 is the require statement. Changing it to an include kills it silently. Putting an is_readable statement before the require confirms that it is readable.


I haven't a clue what is wrong, anyone got 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 naderman » Sun Apr 08, 2012 12:24 pm

What's the result of running ls -l /Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Operation/Exception.php
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 Apr 08, 2012 2:07 pm

Not at my computer right now, but I own it and it is 644.
"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 » Mon Apr 09, 2012 2:58 pm

I was hoping for the actual output.
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 » Mon Apr 09, 2012 3:04 pm

Forgot to do it when I got back, sorry:

-rw-r--r-- 1 callumacrae staff 4013 6 Apr 20:07 /Users/callumacrae/pear/share/pear/PHPUnit/Extensions/Database/Operation/Exception.php
"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 » Tue Apr 10, 2012 6:05 pm

Well try and do what Oleg recommended:

Oleg wrote:6. Copy all pear files into the current directory (/Users/callumacrae/pear/share/pear/ -> .), without preserving permissions.
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 » Wed Apr 11, 2012 1:18 am

Replace require $file on line 161 with:

restore_error_handler();
restore_error_handler();
restore_error_handler();
restore_error_handler();
restore_error_handler();
error_reporting(E_ALL);
include($file);

post output here.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: PHPUnit problem

Postby naderman » Wed Apr 11, 2012 10:27 am

He actually got me access to the machine yesterday. It turns out that if you read any file just there (before the original require), e.g. file_get_contents('/etc/hosts'); PHP will crash. Require seems to avoid that, and returns that error instead, while include also crashes. I recommended he upgrade his PHP, since he was using 5.3.4 which is outdated by several versions.
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

Previous

Return to General Development Discussion

Who is online

Users browsing this forum: No registered users and 8 guests