Merge pull request #14348 from mattwire/sql_engine_config
[civicrm-core.git] / tests / phpunit / CiviTest / CiviTestSuite.php
index cd28f109d4e1e0a346edd5dbb1e3d9d84696e528..df8cf92d7507fa78884f767d1e67701d58f94b0c 100644 (file)
  *   <http://www.gnu.org/licenses/>.
  */
 
-/**
- * Include parent class definition
- */
-require_once 'PHPUnit/Framework/TestSuite.php';
-
 /**
  * Parent class for test suites
  *
  * @package   CiviCRM
  */
-class CiviTestSuite extends PHPUnit_Framework_TestSuite {
+class CiviTestSuite extends PHPUnit\Framework\TestSuite {
 
   /**
-   * Simple name based constructor
+   * Simple name based constructor.
+   * @param string $theClass
+   * @param string $name
    */
   public function __construct($theClass = '', $name = '') {
     if (empty($name)) {
@@ -59,28 +56,29 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
   }
 
   /**
-   *  Test suite setup
+   *  Test suite setup.
    */
   protected function setUp() {
     //print __METHOD__ . "\n";
   }
 
   /**
-   *  Test suite teardown
+   *  Test suite teardown.
    */
   protected function tearDown() {
     //print __METHOD__ . "\n";
   }
 
   /**
-   *  suppress failed test error issued by phpunit when it finds
+   *  suppress failed test error issued by phpunit when it finds.
    *  a test suite with no tests
    */
   public function testNothing() {
   }
 
   /**
-   *
+   * @param $myfile
+   * @return \PHPUnit_Framework_TestSuite
    */
   protected function implSuite($myfile) {
     $name = str_replace('_',
@@ -91,7 +89,7 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
     // also split AllTests to All Tests
     $name = str_replace('AllTests', 'All Tests', $name);
 
-    $suite = new PHPUnit_Framework_TestSuite($name);
+    $suite = new PHPUnit\Framework\TestSuite($name);
     $this->addAllTests($suite, $myfile,
       new SplFileInfo(dirname($myfile))
     );
@@ -101,16 +99,16 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
   /**
    *  Add all test classes *Test and all test suites *Tests in subdirectories
    *
-   * @param PHPUnit_Framework_TestSuite $suite
+   * @param PHPUnit\Framework\TestSuite $suite
+   *   Test suite object to add tests to
    * @param $myfile
    * @param SplFileInfo $dirInfo
+   *   object to scan
    *
-   * @internal param $ &object Test suite object to add tests to
-   * @internal param \Directory $object to scan
-   * @return Test suite has been updated
+   * @return void
    */
   protected function addAllTests(
-    PHPUnit_Framework_TestSuite &$suite,
+    PHPUnit\Framework\TestSuite &$suite,
     $myfile, SplFileInfo $dirInfo
   ) {
     //echo get_class($this)."::addAllTests($myfile,".$dirInfo->getRealPath().")\n";
@@ -121,7 +119,8 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
     }
 
     //  Pass 1:  Check all *Tests.php files
-    $addTests = array(); // array(callable)
+    // array(callable)
+    $addTests = array();
     //echo "start Pass 1 on {$dirInfo->getRealPath()}\n";
     $dir = new DirectoryIterator($dirInfo->getRealPath());
     foreach ($dir as $fileInfo) {
@@ -157,7 +156,8 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
     }
 
     //  Pass 2:  Scan all subdirectories
-    $addAllTests = array(); // array(array(0 => $suite, 1 => $file, 2 => SplFileinfo))
+    // array(array(0 => $suite, 1 => $file, 2 => SplFileinfo))
+    $addAllTests = array();
     $dir = new DirectoryIterator($dirInfo->getRealPath());
     //echo "start Pass 2 on {$dirInfo->getRealPath()}\n";
     foreach ($dir as $fileInfo) {
@@ -178,7 +178,8 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
 
     //  Pass 3:  Check all *Test.php files in this directory
     //echo "start Pass 3 on {$dirInfo->getRealPath()}\n";
-    $addTestSuites = array(); // array(className)
+    // array(className)
+    $addTestSuites = array();
     $dir = new DirectoryIterator($dirInfo->getRealPath());
     foreach ($dir as $fileInfo) {
       if ($fileInfo->isReadable() && $fileInfo->isFile()
@@ -211,4 +212,5 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
 
     // print_r(array($prefix, 'addTests' => $addTests, 'addAllTests' => $addAllTests, 'addTestSuites' => $addTestSuites));
   }
+
 }