Add test to check mail count
authorJitendra Purohit <jitendra@fuzion.co.nz>
Mon, 3 Apr 2017 02:44:10 +0000 (08:14 +0530)
committerJitendra Purohit <jitendra@fuzion.co.nz>
Mon, 3 Apr 2017 02:44:10 +0000 (08:14 +0530)
tests/phpunit/api/v3/ContributionPageTest.php

index eef7495dc749b86d9023a92e09d5612e56d7d7b5..474dd0bcdcab18acd4effd594ca33557a516948b 100644 (file)
@@ -416,6 +416,10 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
     $this->callAPISuccess('contribution_page', 'submit', $submitParams);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page']));
     $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
+    //Assert only one mail is being sent.
+    $msgs = $mut->getAllMessages();
+    $this->assertCount(1, $msgs);
+
     $mut->checkMailLog(array(
          'Membership Type: General',
          'Gruffier',