Merge pull request #15982 from civicrm/5.20
[civicrm-core.git] / tests / phpunit / CRM / Utils / ICalendarTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Tests for linking to resource files
14 * @group headless
15 */
16 class CRM_Utils_ICalendarTest extends CiviUnitTestCase {
17
18 /**
19 * @return array
20 */
21 public function escapeExamples() {
22 $cases = [];
23 $cases[] = ["Hello
24 this is, a test!",
25 ];
26 $cases[] = ["Hello!!
27
28 this is, a \"test\"!",
29 ];
30 return $cases;
31 }
32
33 /**
34 * @param string $testString
35 * @dataProvider escapeExamples
36 */
37 public function testParseStrings($testString) {
38 $this->assertEquals($testString, CRM_Utils_ICalendar::unformatText(CRM_Utils_ICalendar::formatText($testString)));
39 }
40
41 }