<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2020 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
* @package CiviCRM_APIv3
* @subpackage API_Job
*
- * @copyright CiviCRM LLC (c) 2004-2020
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
* @version $Id: Job.php 30879 2010-11-22 15:45:55Z shot $
*
*/
//Execute the job and it should send the mailing to the recipients now.
$this->callAPISuccess('job', 'process_mailing', []);
$this->_mut->assertRecipients($this->getRecipients(1, 2));
+ // Ensure that loading the report produces no errors.
+ $report = CRM_Mailing_BAO_Mailing::report($result['id']);
+ // dev/mailing#56 dev/mailing#57 Ensure that for completed mailings the jobs array is not empty.
+ $this->assertTrue(!empty($report['jobs']));
+ // Ensure that mailing name is correctly stored in the report.
+ $this->assertEquals('mailing name', $report['mailing']['name']);
}
/**
]);
$this->callAPISuccess('mailing', 'create', $this->_params);
$this->_mut->assertRecipients([]);
- $this->callAPIFailure('job', 'process_mailing', "Failure in api call for job process_mailing: Job has not been executed as it is a non-production environment.");
+ $result = $this->callAPIFailure('job', 'process_mailing', []);
+ $this->assertEquals($result['error_message'], "Job has not been executed as it is a Staging (non-production) environment.");
// Test with runInNonProductionEnvironment param.
$this->callAPISuccess('job', 'process_mailing', ['runInNonProductionEnvironment' => TRUE]);