?
Solved

PHPUnit problem

Posted on 2011-09-21
6
Medium Priority
?
345 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

809 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