Ejemplo n.º 1
0
 /**
  * Gets the key of the currently selected testable and saves it to the user settings.
  *
  * @return string the currently selected testable key, will not be empty
  */
 protected function getAndSaveSelectedTestableKey()
 {
     $testableKeyFromSettings = $this->userSettingsService->getAsString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE);
     if ($this->request->hasString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE)) {
         $selectedTestableKey = $this->request->getAsString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE);
     } else {
         $selectedTestableKey = $testableKeyFromSettings;
     }
     if ($selectedTestableKey !== Tx_Phpunit_Testable::ALL_EXTENSIONS && !$this->testFinder->existsTestableForKey($selectedTestableKey)) {
         // We know that phpunit must be loaded.
         $selectedTestableKey = 'phpunit';
     }
     if ($selectedTestableKey !== $testableKeyFromSettings) {
         $this->userSettingsService->set(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE, $selectedTestableKey);
     }
     return $selectedTestableKey;
 }