--- PHPUnitTask-orig.php	2007-04-16 15:56:56.000000000 -0400
+++ PHPUnitTask.php	2007-04-16 15:56:59.000000000 -0400
@@ -78,9 +78,20 @@
 		else
 		{
 			/**
+			 * Try to find PHPUnit3
+			 */
+			@include_once 'PHPUnit/Util/Filter.php';
+			if (class_exists('PHPUnit_Util_Filter'))
+			{
+				PHPUnitUtil::$installedVersion = 3;
+			}
+			
+			/**
 			 * Try to find PHPUnit2
 			 */
-			require_once 'PHPUnit2/Util/Filter.php';
+			else
+			{
+				@include_once 'PHPUnit2/Util/Filter.php';
 			
 			if (!class_exists('PHPUnit2_Util_Filter')) {
 				throw new BuildException("PHPUnit2Task depends on PEAR PHPUnit2 package being installed.", $this->getLocation());
@@ -88,6 +99,12 @@
 			
 			PHPUnitUtil::$installedVersion = 2;
 		}
+			if (!class_exists('PHPUnit_Util_Filter')
+				&& !class_exists('PHPUnit2_Util_Filter'))
+			{
+				throw new BuildException("PHPUnit Task depends on PHPUnit2 or PHPUnit3 being installed", $this->getLocation());
+			}
+		}
 		
 		// other dependencies that should only be loaded when class is actually used.
 		require_once 'phing/tasks/ext/phpunit/PHPUnitTestRunner.php';

