Permalink
Browse files

Upgrade PHPUnit require statements.

git-svn-id: http://svn.php.net/repository/pear/packages/Net_CheckIP2/trunk@320853 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 7c46ccf commit 8479e08c362c130ea9d5b43ca79c722762a3398f Daniel Convissor committed Dec 10, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 tests/AllTests.php
View
@@ -45,9 +45,16 @@
/*
* Files needed by PhpUnit
*/
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-require_once 'PHPUnit/Extensions/PhptTestSuite.php';
+if ($fp = @fopen('PHPUnit/Autoload.php', 'r', true)) {
+ require_once 'PHPUnit/Autoload.php';
+} elseif ($fp = @fopen('PHPUnit/Framework.php', 'r', true)) {
+ require_once 'PHPUnit/Framework.php';
+ require_once 'PHPUnit/TextUI/TestRunner.php';
+ require_once 'PHPUnit/Extensions/PhptTestSuite.php';
+} else {
+ die('skip could not find PHPUnit');
+}
+fclose($fp);
/*
* You must add each additional class-level test suite file here
@@ -62,7 +69,7 @@
/**
* File_IMC_BuildTest
*/
-require_once 'Net_CheckIP2Test.php';
+require_once dirname(__FILE__) . '/Net_CheckIP2Test.php';
/**
* Master Unit Test Suite class for File_IMC

0 comments on commit 8479e08

Please sign in to comment.