3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * Test that content produced by CiviMail looks the way it's expected.
31 * @package CiviCRM_APIv3
34 * @copyright CiviCRM LLC (c) 2004-2018
35 * @version $Id: Job.php 30879 2010-11-22 15:45:55Z shot $
40 * Class CRM_Mailing_MailingSystemTest
42 * MailingSystemTest checks that overall composition and delivery of
43 * CiviMail blasts works. It extends CRM_Mailing_BaseMailingSystemTest
44 * which provides the general test scenarios -- but this variation
45 * checks that certain internal events/hooks fire.
47 * MailingSystemTest is the counterpart to FlexMailerSystemTest.
51 * @see \Civi\FlexMailer\FlexMailerSystemTest
53 class CRM_Mailing_MailingSystemTest
extends CRM_Mailing_BaseMailingSystemTest
{
57 public function setUp() {
59 Civi
::settings()->add(array('experimentalFlexMailerEngine' => FALSE));
61 $hooks = \CRM_Utils_Hook
::singleton();
62 $hooks->setHook('civicrm_alterMailParams',
63 array($this, 'hook_alterMailParams'));
67 * @see CRM_Utils_Hook::alterMailParams
69 public function hook_alterMailParams(&$params, $context = NULL) {
70 $this->counts
['hook_alterMailParams'] = 1;
71 $this->assertEquals('civimail', $context);
74 public function tearDown() {
76 $this->assertNotEmpty($this->counts
['hook_alterMailParams']);
79 // ---- Boilerplate ----
81 // The remainder of this class contains dummy stubs which make it easier to
82 // work with the tests in an IDE.
85 * Generate a fully-formatted mailing (with body_html content).
87 * @dataProvider urlTrackingExamples
89 public function testUrlTracking(
95 parent
::testUrlTracking($inputHtml, $htmlUrlRegex, $textUrlRegex, $params);
98 public function testBasicHeaders() {
99 parent
::testBasicHeaders();
102 public function testText() {
106 public function testHtmlWithOpenTracking() {
107 parent
::testHtmlWithOpenTracking();
110 public function testHtmlWithOpenAndUrlTracking() {
111 parent
::testHtmlWithOpenAndUrlTracking();