Solved

PHPUnit problem

Posted on 2011-09-21
6
332 Views
Last Modified: 2013-12-13
I have installed phpunit but when I run (at macos command prompt)  the command phpunit --version I get the following errors:

PHP Warning:  require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /Users/skiabox/pear/bin/phpunit on line 38
PHP Fatal error:  require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/Users/skiabox/ZendFramework/library:/Users/skiabox/pear/bin') in /Users/skiabox/pear/bin/phpunit on line 38


Any ideas guys?
Thank you.
0
Comment
Question by:skiabox
  • 3
  • 2
6 Comments
 
LVL 13

Expert Comment

by:Andrew Derse
ID: 36576614
Can you post the file that is causing the error?  It appears that it is located in these directories:

PHP\CodeCoverage\Filter.php

My guess is that this file doesn't exist.  It's being called in your script in line 38, but it can't find it at: Users\skiabox\pear\bin.  Does the file exist?  If so, is it readyonly?  Try giving it full permissions to see what that will do.  
0
 

Author Comment

by:skiabox
ID: 36576913
The file exists :
/Users/skiabox/pear/share/pear/PHP/CodeCoverage

phpunit is located at /Users/skiabox/pear/bin

My operating system is MacOS.

What do you suggest me doing?

Thnx again.
0
 

Author Comment

by:skiabox
ID: 36577207
Pear version is 1.9.4
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 36577239
The problem is that the path PHP\CodeCoverage\Filter.php is relative to the script. If the script is running in (say) /www/htdocs/test then the Require_once is looking in/www/htdocs/test/PHP/CodeCoverage/Filter.php

Either specify the FULL path on the require

require_once "/Users/skiabox/pear/share/pear/PHP/CodeCoverage/Filter.php"

or ensure that "/Users/skiabox/pear/share/pear" is in the include_path using ini_set and ini_get.

ini_set( "/Users/skiabox/pear/share/pear/:" . ini_get('include_path') );

0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 36577247
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 36577251
Looking at the error again, the include path has /Users/skiabox/pear/bin rather than /Users/skiabox/pear/share/pear

Another option is to move or copy the script Filter.php to /Users/skiabox/pear/bin or place a symbolic link there
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now