Solved

PHPUnit problem

Posted on 2011-09-21
6
334 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What does != "" mean in programming 8 82
Change background color in td if any value is 1 9 24
What's wrong with this PDO query? 5 28
Email called spam 5 36
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

830 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