commit 3c41e3c95fd4c143762722eb45b4082ccb6445f2 Author: Matthew Radcliffe Date: Mon Sep 22 15:25:08 2014 -0400 Issue #1303400 by mradcliffe: Remove assertMailPattern() assertions because Core doesn't provide an accurate way of immediately retrieving e-mails sent. diff --git a/tests/functional/ServicesResourceUserTests.test b/tests/functional/ServicesResourceUserTests.test index 8b8d464..7c84774 100644 --- a/tests/functional/ServicesResourceUserTests.test +++ b/tests/functional/ServicesResourceUserTests.test @@ -651,8 +651,6 @@ class ServicesResourceUsertests extends ServicesWebtestCase { 'Resource to request a new password for user name has been called successfully.', 'UserResource: request_new_password'); - $this->assertMailPattern('subject', 'Replacement login information', 1); - // Request new password for user by e-mail address. $data = array('name' => $account->mail); $response = $this->servicesPost($this->endpoint->path . '/user/request_new_password', $data); @@ -660,13 +658,17 @@ class ServicesResourceUsertests extends ServicesWebtestCase { 'Resource to request a new password for user name has been called successfully.', 'UserResource: request_new_password'); - $this->assertMailPattern('subject', 'Replacement login information', 1); - // Assert 406 response for user that does not exist. $data = array('name' => $this->randomName(10) . '@example.com'); $response = $this->servicesPost($this->endpoint->path . '/user/request_new_password', $data); $this->assertEqual(406, $response['code'], 'Resource to request new password for non-existing user name returned content not acceptable.', 'UserResource: request_new_password'); + + // Assert that 2 e-mails were sent in this test. The drupalGetMails() + // method does not provide immediate feedback about e-mails sent during the + // test, and so this assertion can only be done at this point. + $mails = $this->drupalGetMails(); + $this->assertEqual(2, count($mails), 'Only 2 e-mails were sent during this test.'); } }