Issue #2392427 by Arla: Too strict schema for system.mail:interface

8.0.x
Alex Pott 2014-12-20 13:21:27 +00:00
parent 26dfabc367
commit 2a7aaa09b0
2 changed files with 18 additions and 7 deletions

View File

@ -330,12 +330,11 @@ system.mail:
label: 'Mail system'
mapping:
interface:
type: mapping
label: 'Interface'
mapping:
default:
type: string
label: 'Default'
type: sequence
label: 'Interfaces'
sequence:
- type: string
label: 'Interface'
system.theme.global:
type: theme_settings

View File

@ -7,7 +7,9 @@
namespace Drupal\system\Tests\Mail;
use Drupal\Core\Mail\Plugin\Mail\TestMailCollector;
use Drupal\simpletest\WebTestBase;
use Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure;
/**
* Performs tests on the pluggable mailing framework.
@ -43,7 +45,17 @@ class MailTest extends WebTestBase {
// Assert whether the default mail backend is an instance of the expected
// class.
$this->assertTrue($mail_backend instanceof \Drupal\system_mail_failure_test\Plugin\Mail\TestPhpMailFailure, 'Pluggable mail system is extendable.');
$this->assertTrue($mail_backend instanceof TestPhpMailFailure, 'Default mail interface can be swapped.');
// Add a module-specific mail backend.
\Drupal::config('system.mail')->set('interface.mymodule_testkey', 'test_mail_collector')->save();
// Get the added MailInterface class instance.
$mail_backend = \Drupal::service('plugin.manager.mail')->getInstance(array('module' => 'mymodule', 'key' => 'testkey'));
// Assert whether the added mail backend is an instance of the expected
// class.
$this->assertTrue($mail_backend instanceof TestMailCollector, 'Additional mail interfaces can be added.');
}
/**