Skip to content

Commit

Permalink
Use setModuleOverride not global config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanjfshaw authored and jhedstrom committed Mar 15, 2018
1 parent 9db54b6 commit 93f806f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/Drupal/Driver/Cores/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,16 @@ public function entityDelete($entity_type, $entity) {
* {@inheritdoc}
*/
public function startCollectingMail() {
global $config;
// @todo Use a collector that supports html after D#2223967 lands.
$config['system.mail']['interface.default'] = 'test_mail_collector';
\Drupal::config('system.mail')->setModuleOverride(['interface' => ['default' => 'test_mail_collector']]);
}

/**
* {@inheritdoc}
*/
public function stopCollectingMail() {
global $config;
$original = \Drupal::config('system.mail')->getOriginal('interface.default', FALSE);
$config['system.mail']['interface.default'] = $original;
\Drupal::config('system.mail')->setModuleOverride(['interface' => ['default' => $original]]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/Driver/DriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function stopCollectingMail();
*
* @return \stdClass[]
* An array of collected emails, each formatted as a Drupal 8
* \Drupal\Core\Mail\MailInterface::mail $message array.
* \Drupal\Core\Mail\MailInterface::mail $message array.
*/
public function getMail();

Expand Down

0 comments on commit 93f806f

Please sign in to comment.