/**
  * @AfterScenario
  *
  * Reset the values after the last scenario of the feature and disable the testing app
  * @param AfterScenarioScope $event
  */
 public function undoChangingParameters(AfterScenarioScope $event)
 {
     $scenarios = $event->getFeature()->getScenarios();
     if ($event->getScenario() === end($scenarios)) {
         $user = $this->currentUser;
         $this->currentUser = '******';
         $this->resetAppConfigs();
         $this->setStatusTestingApp(false);
         $this->currentUser = $user;
     }
 }
 /**
  * @AfterScenario
  */
 public function takeDatabaseDumpAfterFailedStep(AfterScenarioScope $scope)
 {
     if ($this->screenshot_dir && TestResult::FAILED === $scope->getTestResult()->getResultCode()) {
         $feature = $scope->getFeature();
         $scenario = $scope->getScenario();
         $filename = basename($feature->getFile(), '.feature') . '-' . $scenario->getLine();
         $filepath = $this->screenshot_dir . $filename . '.sql';
         try {
             $dump = new Mysqldump('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD);
             $dump->start($filepath);
         } catch (\Exception $e) {
             echo 'mysqldump-php error: ' . $e->getMessage();
         }
     }
 }