- include PHPUnit/Framework.php
authorChuck Hagenbuch <chuck@horde.org>
Tue, 29 Sep 2009 17:24:29 +0000 (13:24 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Tue, 29 Sep 2009 17:24:29 +0000 (13:24 -0400)
- don't use include_once or silence calls in on-the-fly autoloader

14 files changed:
framework/Argv/test/Horde/Argv/AllTests.php
framework/Auth/test/Horde/Auth/AllTests.php
framework/Constraint/test/Horde/Constraint/AllTests.php
framework/Controller/test/Horde/Controller/AllTests.php
framework/Date/test/Horde/Date/AllTests.php
framework/Http/lib/Horde/Http/Response/Mock.php
framework/Log/test/Horde/Log/AllTests.php
framework/Pdf/test/Horde/Pdf/AllTests.php
framework/Routes/test/Horde/Routes/AllTests.php
framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php
framework/Support/test/Horde/Support/AllTests.php
framework/Text_Textile/test/Horde/Text/Textile/AllTests.php
framework/View/test/Horde/View/AllTests.php
framework/Xml_Element/test/Horde/Xml/Element/AllTests.php

index f728a35..7192f5e 100644 (file)
@@ -20,7 +20,7 @@ if (!function_exists('_')) {
     }
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
index 6c5e091..b9524aa 100644 (file)
  */
 
 /**
- * Define the main method 
+ * Define the main method
  */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Auth_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
@@ -43,7 +43,6 @@ require_once 'PHPUnit/TextUI/TestRunner.php';
  */
 class Horde_Auth_AllTests
 {
-
     /**
      * Main entry point for running the suite.
      *
@@ -80,7 +79,6 @@ class Horde_Auth_AllTests
 
         return $suite;
     }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Auth_AllTests::main') {
index c196808..2a78538 100644 (file)
@@ -8,9 +8,8 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Constraint_AllTests::main');
 }
 
-if (!spl_autoload_functions()) {
-    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
-}
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
 
 class Horde_Constraint_AllTests
 {
@@ -21,7 +20,11 @@ class Horde_Constraint_AllTests
 
     public static function suite()
     {
+        if (!spl_autoload_functions()) {
+            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";'));
+        }
         set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
+
         $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Constraint');
 
         $basedir = dirname(__FILE__);
index 7819e1b..0ff1863 100644 (file)
@@ -16,7 +16,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Controller_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
index c68efa6..c5a7eea 100644 (file)
@@ -11,7 +11,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Date_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 class Horde_Date_AllTests {
index 0907c28..e6438c5 100644 (file)
@@ -16,4 +16,8 @@
  */
 class Horde_Http_Response_Mock extends Horde_Http_Response_Base
 {
+    public function getBody()
+    {
+        return $this->body;
+    }
 }
index be00b37..d7146c2 100644 (file)
@@ -40,7 +40,7 @@ class Horde_Log_AllTests
     public static function suite()
     {
         if (!spl_autoload_functions()) {
-            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
+            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";'));
         }
         set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
 
index ef53db6..1e53792 100644 (file)
@@ -12,7 +12,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde::Pdf::AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
index 17712a0..9e1a24f 100644 (file)
@@ -24,7 +24,7 @@ require_once "$lib/Mapper.php";
 require_once "$lib/Route.php";
 require_once "$lib/Exception.php";
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
@@ -44,7 +44,7 @@ class Horde_Routes_AllTests
         $basedir = dirname(__FILE__);
         $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/');
 
-        foreach(new RecursiveIteratorIterator(
+        foreach (new RecursiveIteratorIterator(
                  new RecursiveDirectoryIterator($basedir)) as $file) {
             if ($file->isFile() && preg_match('/Test.php$/', $file->getFilename())) {
                 $pathname = $file->getPathname();
index a7842cb..a48829a 100644 (file)
@@ -11,9 +11,8 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Stream_Filter_AllTests::main');
 }
 
-if (!spl_autoload_functions()) {
-    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
-}
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
  * @package    Horde_Stream_Filter
index c78680f..98f7d66 100644 (file)
@@ -11,7 +11,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Support_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 class Horde_Support_AllTests {
index 9e41caf..4c06a52 100755 (executable)
@@ -9,7 +9,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Text_Textile_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
index 424ccf9..eefb623 100644 (file)
@@ -33,7 +33,7 @@ class Horde_View_AllTests {
         // Set up autoload
         set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path());
         if (!spl_autoload_functions()) {
-            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
+            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";'));
         }
 
         // Build the suite
index b80b1c3..530ad52 100644 (file)
@@ -11,7 +11,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Xml_Element_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
 class Horde_Xml_Element_AllTests {