Reduce indention.
authorJan Schneider <jan@horde.org>
Thu, 18 Mar 2010 17:12:49 +0000 (18:12 +0100)
committerJan Schneider <jan@horde.org>
Thu, 18 Mar 2010 17:47:02 +0000 (18:47 +0100)
framework/bin/test_framework

index 9d46765..734180f 100755 (executable)
@@ -40,38 +40,42 @@ class horde_test_runner
 
         // Find all AllTests.php files.
         foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
-            if ($file->isFile() && $file->getFilename() == 'AllTests.php' && $file->getPathname() != __FILE__ && $file->getPathname() != $basedir . '/Test/lib/Horde/Test/AllTests.php') {
-                $pathname = $file->getPathname();
+            if (!$file->isFile() |
+                $file->getFilename() != 'AllTests.php' ||
+                $file->getPathname() == __FILE__ |
+                $file->getPathname() == $basedir . '/Test/lib/Horde/Test/AllTests.php') {
+                continue;
+            }
+            $pathname = $file->getPathname();
 
-                // Include the test suite.
-                require $pathname;
+            // Include the test suite.
+            require $pathname;
 
-                // Generate possible classnames (namespaced and
-                // non-namespaced, with and without Horde_, _tests_,
-                // and the full tests/Horde/... hierarchy).
-                $class = str_replace(DIRECTORY_SEPARATOR, '_', preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
-                $class_notests = preg_replace('/_tests?/', '', $class);
-                $class_horde = 'Horde_' . $class;
-                $class_horde_notests = 'Horde_' . $class_notests;
-                $class_pear2 = preg_replace('/' . substr($class, 0, strpos($class, '_')) . '_tests?_/', '', $class);
-                $class_pear2_notests = preg_replace('/\w+_tests?_/', '', $class);
+            // Generate possible classnames (namespaced and non-namespaced,
+            // with and without Horde_, _tests_, and the full
+            // tests/Horde/... hierarchy).
+            $class = str_replace(DIRECTORY_SEPARATOR, '_', preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
+            $class_notests = preg_replace('/_tests?/', '', $class);
+            $class_horde = 'Horde_' . $class;
+            $class_horde_notests = 'Horde_' . $class_notests;
+            $class_pear2 = preg_replace('/' . substr($class, 0, strpos($class, '_')) . '_tests?_/', '', $class);
+            $class_pear2_notests = preg_replace('/\w+_tests?_/', '', $class);
 
-                $classnames = array($class, $class_notests, $class_horde, $class_horde_notests, $class_pear2, $class_pear2_notests);
-                foreach ($classnames as $classname) {
-                    $classnames[] = str_replace('_', '\\', $classname);
-                }
+            $classnames = array($class, $class_notests, $class_horde, $class_horde_notests, $class_pear2, $class_pear2_notests);
+            foreach ($classnames as $classname) {
+                $classnames[] = str_replace('_', '\\', $classname);
+            }
 
-                // Look for something with a ::suite() method.
-                foreach ($classnames as $classname) {
-                    // We've already included the AllTests.php file,
-                    // so explicitly disable autoloading in the
-                    // class_exists check. Otherwise we can get all
-                    // kinds of double-define errors.
-                    if (class_exists($classname, false)) {
-                        // Once we've found a usable test suite, add it and move on.
-                        $suite->addTestSuite(call_user_func(array($classname, 'suite')));
-                        break;
-                    }
+            // Look for something with a ::suite() method.
+            foreach ($classnames as $classname) {
+                // We've already included the AllTests.php file, so explicitly
+                // disable autoloading in the class_exists check. Otherwise we
+                // can get all kinds of double-define errors.
+                if (class_exists($classname, false)) {
+                    // Once we've found a usable test suite, add it and move
+                    // on.
+                    $suite->addTestSuite(call_user_func(array($classname, 'suite')));
+                    break;
                 }
             }
         }