Hello,
Is it possible to use phpunit 2 or phpunit 3 by using the include statement without installing? (As we do with phpunit 1.3)?
Thanx
PHPUnit2/PHPUnit3 installation
Moderator: General Moderators
i renamed phpunit to phpunit2.php, i did not change #!@php_bin@. what path should i have to give there?
in the testcase,
#!@php_bin@
Warning: require(PHPUnit2/TextUI/TestRunner.php) [function.require]: failed to open stream: No such file or directory in D:\Projects\proj1\classes\PHPUNIT2\PHPUnit2.php on line 40
Fatal error: require() [function.require]: Failed opening required 'PHPUnit2/TextUI/TestRunner.php' (include_path='PHPUNIT2/') in D:\Projects\proj1\classes\PHPUNIT2\PHPUnit2.php on line 40
Thanx
in the testcase,
Code: Select all
<?php
set_include_path("PHPUNIT2/");
require_once 'membertypes.php';
require_once 'PHPUnit2.php';
...
?>Warning: require(PHPUnit2/TextUI/TestRunner.php) [function.require]: failed to open stream: No such file or directory in D:\Projects\proj1\classes\PHPUNIT2\PHPUnit2.php on line 40
Fatal error: require() [function.require]: Failed opening required 'PHPUnit2/TextUI/TestRunner.php' (include_path='PHPUNIT2/') in D:\Projects\proj1\classes\PHPUNIT2\PHPUnit2.php on line 40
Thanx
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Based on your require usage, you should have a file at location (relative):
PHPUNIT2/PHPUnit2/TextUI/TestRunner.php
And yes, the PHPUnit2 directory really should be inside the all-capitals PHPUNIT2 directory. The include_path should point to whichever directory contains the PHPUnit2 package under the PEAR convention. Also, when setting an include path, for compatibility with any other PEAR or included paths, you should add your path to the contents of get_include_path().
PHPUNIT2/PHPUnit2/TextUI/TestRunner.php
And yes, the PHPUnit2 directory really should be inside the all-capitals PHPUNIT2 directory. The include_path should point to whichever directory contains the PHPUnit2 package under the PEAR convention. Also, when setting an include path, for compatibility with any other PEAR or included paths, you should add your path to the contents of get_include_path().
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Just reiterating that:
PHPUnit2/TextUI/TestRunner.php is a relative path *from* the parent include_path entry. If you have set the include_path to PHPUnit2 and your capitalised PHPUNIT2 is not a parent directory (i.e. above the non-capitalised PHPUnit2) than you have the include_path setup wrong - hence the fatal error if using from a webserver.
If using the PHP command line, you should add the include_path directly to the php.ini file. Also be warned - on Windows the PHP command line will use any php.ini file in the Windows or System32 folders in favour of any other alternative. I've seen some people installing standalone PHP versions, then installing other alternatives like XAMPP, and forget to delete the old php.ini instances. Makes for some puzzling moments when using PHP CLI - e.g. managing your PEAR packages.
php_bin should be set as an environment variable in your system. Its value is the full path to the PHP bin directory - see your PHP install for details.
PHPUnit2/TextUI/TestRunner.php is a relative path *from* the parent include_path entry. If you have set the include_path to PHPUnit2 and your capitalised PHPUNIT2 is not a parent directory (i.e. above the non-capitalised PHPUnit2) than you have the include_path setup wrong - hence the fatal error if using from a webserver.
If using the PHP command line, you should add the include_path directly to the php.ini file. Also be warned - on Windows the PHP command line will use any php.ini file in the Windows or System32 folders in favour of any other alternative. I've seen some people installing standalone PHP versions, then installing other alternatives like XAMPP, and forget to delete the old php.ini instances. Makes for some puzzling moments when using PHP CLI - e.g. managing your PEAR packages.
php_bin should be set as an environment variable in your system. Its value is the full path to the PHP bin directory - see your PHP install for details.