/** * Used to broker incoming requests to other calls. * Called by typo3/ajax.php * * @param array $unused additional parameters (not used) * @param AjaxRequestHandler $ajax the AJAX object for this request * * @return void */ public function ajaxBroker(array $unused, AjaxRequestHandler $ajax) { $state = (bool) GeneralUtility::_POST('state'); $checkbox = GeneralUtility::_POST('checkbox'); if (in_array($checkbox, $this->validCheckboxKeys, true)) { $ajax->setContentFormat('json'); $this->userSettingsService->set($checkbox, $state); $ajax->addContent('success', true); } else { $ajax->setContentFormat('plain'); $ajax->setError('Illegal input parameters.'); } }
/** * 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; }
/** * Used to broker incoming requests to other calls. * Called by typo3/ajax.php * * @param array $unused additional parameters (not used) * @param TYPO3AJAX $ajax the AJAX object for this request * * @return void */ public function ajaxBroker(array $unused, TYPO3AJAX $ajax) { $state = (bool) t3lib_div::_POST('state'); $checkbox = t3lib_div::_POST('checkbox'); if (in_array($checkbox, $this->validCheckboxKeys, TRUE)) { $ajax->setContentFormat('json'); $this->userSettingsService->set($checkbox, $state); $ajax->addContent('success', TRUE); } else { $ajax->setContentFormat('plain'); $ajax->setError('Illegal input parameters.'); } }
/** * 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'); }