protected function findMailSystemSenders(array $data) {
    foreach ($data as $key => $values) {
      if (is_array($values)) {
        if (isset($values[MailsystemManager::MAILSYSTEM_TYPE_SENDING])) {
          $data[$key][MailsystemManager::MAILSYSTEM_TYPE_SENDING] = 'test_mail_collector';
        }
        else {
          $data[$key] = $this->findMailSystemSenders($values);
        }
      }
    }
    return $data;
  }
protected function findMailSystemSenders(array $data) {
    foreach ($data as $key => $values) {
      if (is_array($values)) {
        if (isset($values[MailsystemManager::MAILSYSTEM_TYPE_SENDING])) {
          $data[$key][MailsystemManager::MAILSYSTEM_TYPE_SENDING] = 'test_mail_collector';
        }
        else {
          $data[$key] = $this->findMailSystemSenders($values);
        }
      }
    }
    return $data;
  }
protected function findMailSystemSenders ( array $ data ) { foreach ( $ data as $ key => $ values ) { if ( is_array ( $ values ) ) { if ( isset ( $ values [ MailsystemManager :: MAILSYSTEM_TYPE_SENDING ] ) ) { $ data [ $ key ] [ MailsystemManager :: MAILSYSTEM_TYPE_SENDING ] = 'test_mail_collector' ; } else { $ data [ $ key ] = $ this -> findMailSystemSenders ( $ values ) ; } } } return $ data ; }
Find and replace all the mail system sender plugins with the test plugin.

This method calls itself recursively.
Find and replace all the mail system sender plugins with the test plugin .