Solved

PHPUnit problem

Posted on 2011-09-21
6
331 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:NUKIT
Comment Utility
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
Comment Utility
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
Comment Utility
Pear version is 1.9.4
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
Comment Utility
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
Comment Utility
0
 
LVL 34

Expert Comment

by:Beverley Portlock
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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.

771 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

8 Experts available now in Live!

Get 1:1 Help Now