diff --git a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php index f03d586..9ef8d20 100644 --- a/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Mail/MailManagerTest.php @@ -30,7 +30,7 @@ class MailManagerTest extends UnitTestCase { /** * The language manager. * - * @var \Drupal\Core\Language\LanguageManager|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $languageManager; @@ -97,14 +97,8 @@ protected function setUp() { $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); - // Mock a CachedDiscovery object to replace AnnotationClassDiscovery. - $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface'); - foreach ($this->definitions as $id => $definition) { - $definitions_map[] = array($id, $definition); - } - $this->discovery->expects($this->any()) - ->method('getDefinition') - ->will($this->returnValueMap($definitions_map)); + // Mock a Discovery object to replace AnnotationClassDiscovery. + $this->discovery = $this->getMock('Drupal\Component\Plugin\Discovery\DiscoveryInterface'); $this->discovery->expects($this->any()) ->method('getDefinitions') ->will($this->returnValue($this->definitions)); @@ -131,7 +125,7 @@ protected function setUpMailManager($interface = array()) { public function testGetInstance() { $interface = array( 'default' => 'php_mail', - 'mailmanagertest_getinstance' => 'test_mail_collector', + 'example_testkey' => 'test_mail_collector', ); $this->setUpMailManager($interface); @@ -141,7 +135,7 @@ public function testGetInstance() { $this->assertInstanceOf('Drupal\Core\Mail\Plugin\Mail\PhpMail', $instance); // Test that a matching message_id returns the specified plugin instance. - $options = array('module' => 'mailmanagertest', 'key' => 'getinstance'); + $options = array('module' => 'example', 'key' => 'testkey'); $instance = $this->mailManager->getInstance($options); $this->assertInstanceOf('Drupal\Core\Mail\Plugin\Mail\TestMailCollector', $instance); }