Merge pull request #12383 from civicrm/5.3
[civicrm-core.git] / tests / phpunit / CiviTest / CiviTestSuite.php
index 8cfc8a1c0eee1a5fd7c7b12bbbe357e84df01a4e..4dd175274b447a7b75f01dc418fd42fb1b40043f 100644 (file)
  *   <http://www.gnu.org/licenses/>.
  */
 
-/**
- * Include parent class definition
- */
-require_once 'PHPUnit/Framework/TestSuite.php';
-
 /**
  * Parent class for test suites
  *
@@ -39,9 +34,11 @@ require_once 'PHPUnit/Framework/TestSuite.php';
 class CiviTestSuite extends PHPUnit_Framework_TestSuite {
 
   /**
-   * Simple name based constructor
+   * Simple name based constructor.
+   * @param string $theClass
+   * @param string $name
    */
-  function __construct($theClass = '', $name = '') {
+  public function __construct($theClass = '', $name = '') {
     if (empty($name)) {
       $name = str_replace('_',
         ' ',
@@ -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
    */
-  function testNothing() {
+  public function testNothing() {
   }
 
   /**
-   *
+   * @param $myfile
+   * @return \PHPUnit_Framework_TestSuite
    */
   protected function implSuite($myfile) {
     $name = str_replace('_',
@@ -102,15 +100,16 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
    *  Add all test classes *Test and all test suites *Tests in subdirectories
    *
    * @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,
-                                 $myfile, SplFileInfo $dirInfo
+  protected function addAllTests(
+    PHPUnit_Framework_TestSuite &$suite,
+    $myfile, SplFileInfo $dirInfo
   ) {
     //echo get_class($this)."::addAllTests($myfile,".$dirInfo->getRealPath().")\n";
     if (!$dirInfo->isReadable()
@@ -210,4 +209,5 @@ class CiviTestSuite extends PHPUnit_Framework_TestSuite {
 
     // print_r(array($prefix, 'addTests' => $addTests, 'addAllTests' => $addAllTests, 'addTestSuites' => $addTestSuites));
   }
+
 }