(NFC) Update version headers in `tests/`
[civicrm-core.git] / tests / phpunit / CRM / Mailing / MailingSystemTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27
28 /**
29 * Test that content produced by CiviMail looks the way it's expected.
30 *
31 * @package CiviCRM_APIv3
32 * @subpackage API_Job
33 *
34 * @copyright CiviCRM LLC (c) 2004-2018
35 * @version $Id: Job.php 30879 2010-11-22 15:45:55Z shot $
36 *
37 */
38
39 /**
40 * Class CRM_Mailing_MailingSystemTest
41 *
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.
46 *
47 * MailingSystemTest is the counterpart to FlexMailerSystemTest.
48 *
49 * @group headless
50 * @group civimail
51 * @see \Civi\FlexMailer\FlexMailerSystemTest
52 */
53 class CRM_Mailing_MailingSystemTest extends CRM_Mailing_BaseMailingSystemTest {
54
55 private $counts;
56
57 public function setUp() {
58 parent::setUp();
59 Civi::settings()->add(array('experimentalFlexMailerEngine' => FALSE));
60
61 $hooks = \CRM_Utils_Hook::singleton();
62 $hooks->setHook('civicrm_alterMailParams',
63 array($this, 'hook_alterMailParams'));
64 }
65
66 /**
67 * @see CRM_Utils_Hook::alterMailParams
68 */
69 public function hook_alterMailParams(&$params, $context = NULL) {
70 $this->counts['hook_alterMailParams'] = 1;
71 $this->assertEquals('civimail', $context);
72 }
73
74 public function tearDown() {
75 parent::tearDown();
76 $this->assertNotEmpty($this->counts['hook_alterMailParams']);
77 }
78
79 // ---- Boilerplate ----
80
81 // The remainder of this class contains dummy stubs which make it easier to
82 // work with the tests in an IDE.
83
84 /**
85 * Generate a fully-formatted mailing (with body_html content).
86 *
87 * @dataProvider urlTrackingExamples
88 */
89 public function testUrlTracking(
90 $inputHtml,
91 $htmlUrlRegex,
92 $textUrlRegex,
93 $params
94 ) {
95 parent::testUrlTracking($inputHtml, $htmlUrlRegex, $textUrlRegex, $params);
96 }
97
98 public function testBasicHeaders() {
99 parent::testBasicHeaders();
100 }
101
102 public function testText() {
103 parent::testText();
104 }
105
106 public function testHtmlWithOpenTracking() {
107 parent::testHtmlWithOpenTracking();
108 }
109
110 public function testHtmlWithOpenAndUrlTracking() {
111 parent::testHtmlWithOpenAndUrlTracking();
112 }
113
114 }