public function _afterSuite() {

    if (isset($this->users)) {
      $users = User::loadMultiple($this->users);
      /** @var \Drupal\user\Entity\User $user */
      foreach ($users as $user) {
        $user->delete();
      }
    }

    if ($this->config['check_logs']) {
      if (\Drupal::moduleHandler()->moduleExists('dblog')) {
        // @todo Make log levels configurable
        // Load any database log entries of level WARNING or more serious.
        $query = \Drupal::database()->select('watchdog', 'w');
        $query->fields('w', ['type', 'severity', 'message', 'variables'])
          ->condition('severity', RfcLogLevel::NOTICE, '<=')
          ->condition('type', 'php');
        $result = $query->execute();
        foreach ($result as $row) {
          // Build a readable message and declare a failure.
          $variables = @unserialize($row->variables);
          $message = $row->type . ' - ';
          $message .= RfcLogLevel::getLevels()[$row->severity] . ': ';
          $message .= t(Xss::filterAdmin($row->message), $variables)->render();
          $this->fail($message);
        }
      }
    }
  }
public function _afterSuite() {

    if (isset($this->users)) {
      $users = User::loadMultiple($this->users);
      /** @var \Drupal\user\Entity\User $user */
      foreach ($users as $user) {
        $user->delete();
      }
    }

    if ($this->config['check_logs']) {
      if (\Drupal::moduleHandler()->moduleExists('dblog')) {
        // @todo Make log levels configurable
        // Load any database log entries of level WARNING or more serious.
        $query = \Drupal::database()->select('watchdog', 'w');
        $query->fields('w', ['type', 'severity', 'message', 'variables'])
          ->condition('severity', RfcLogLevel::NOTICE, '<=')
          ->condition('type', 'php');
        $result = $query->execute();
        foreach ($result as $row) {
          // Build a readable message and declare a failure.
          $variables = @unserialize($row->variables);
          $message = $row->type . ' - ';
          $message .= RfcLogLevel::getLevels()[$row->severity] . ': ';
          $message .= t(Xss::filterAdmin($row->message), $variables)->render();
          $this->fail($message);
        }
      }
    }
  }
public function _afterSuite ( ) { if ( isset ( $ this -> users ) ) { $ users = User :: loadMultiple ( $ this -> users ) ; /** @var \Drupal\user\Entity\User $user */ foreach ( $ users as $ user ) { $ user -> delete ( ) ; } } if ( $ this -> config [ 'check_logs' ] ) { if ( \ Drupal :: moduleHandler ( ) -> moduleExists ( 'dblog' ) ) { // @todo Make log levels configurable // Load any database log entries of level WARNING or more serious. $ query = \ Drupal :: database ( ) -> select ( 'watchdog' , 'w' ) ; $ query -> fields ( 'w' , [ 'type' , 'severity' , 'message' , 'variables' ] ) -> condition ( 'severity' , RfcLogLevel :: NOTICE , '<=' ) -> condition ( 'type' , 'php' ) ; $ result = $ query -> execute ( ) ; foreach ( $ result as $ row ) { // Build a readable message and declare a failure. $ variables = @ unserialize ( $ row -> variables ) ; $ message = $ row -> type . ' - ' ; $ message .= RfcLogLevel :: getLevels ( ) [ $ row -> severity ] . ': ' ; $ message .= t ( Xss :: filterAdmin ( $ row -> message ) , $ variables ) -> render ( ) ; $ this -> fail ( $ message ) ; } } } }
Tear down after tests.
Tear down after tests .