Example #1
0
 /**
  * Checks whether $className is the name of a non-abstract subclass of the test case base class.
  *
  * This function also checks for Selenium test cases whether Selenium tests are enabled in the user settings.
  *
  * @param string $className the class name to check, must not be empty
  *
  * @return bool whether the corresponding class is both non-abstract and a subclass of the test case base class
  */
 protected function classNameIsNonAbstractSubclassOfValidBaseTestCase($className)
 {
     $classReflection = new ReflectionClass($className);
     $result = !$classReflection->isAbstract() && $classReflection->isSubclassOf(self::BASE_TEST_CASE_CLASS_NAME);
     if (!$this->userSettingsService->getAsBoolean('runSeleniumTests')) {
         if (class_exists(self::SELENIUM_BASE_TEST_CASE_CLASS_NAME, true)) {
             $result = $result && !$classReflection->isSubclassOf(self::SELENIUM_BASE_TEST_CASE_CLASS_NAME);
         }
     }
     return $result;
 }
Example #2
0
 /**
  * Checks whether code coverage information should be collected.
  *
  * @return boolean whether code coverage information should be collected
  */
 protected function shouldCollectCodeCoverageInformation()
 {
     return $this->userSettingsService->getAsBoolean('codeCoverage') && extension_loaded('xdebug');
 }