]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/EmailTemplates/Bug60152Test.php
Release 6.5.10
[Github/sugarcrm.git] / tests / modules / EmailTemplates / Bug60152Test.php
1 <?php
2
3 /*********************************************************************************
4  * By installing or using this file, you are confirming on behalf of the entity
5  * subscribed to the SugarCRM Inc. product ("Company") that Company is bound by
6  * the SugarCRM Inc. Master Subscription Agreement (\93MSA\94), which is viewable at:
7  * http://www.sugarcrm.com/master-subscription-agreement
8  *
9  * If Company is not bound by the MSA, then by installing or using this file
10  * you are agreeing unconditionally that Company will be bound by the MSA and
11  * certifying that you have authority to bind Company accordingly.
12  *
13  * Copyright (C) 2004-2013 SugarCRM Inc.  All rights reserved.
14  ********************************************************************************/
15
16
17 /**
18  * Bug #60152
19  * Using Alert Template Variables in the TinyMCE Editor Link replaces '{' and '}' with '%7B' and '%7D'
20  *
21  * @author mgusev@sugarcrm.com
22  * @ticked 60152
23  */
24 class Bug60152Test extends Sugar_PHPUnit_Framework_TestCase
25 {
26
27     /**
28      * Test asserts that body_html has variables after cleanBean call
29      *
30      * @group 60152
31      * @dataProvider dataProvider
32      * @return void
33      */
34     public function testCleanBean($html, $needle)
35     {
36         $bean = new EmailTemplate();
37         $bean->body_html = $html;
38         $bean->cleanBean();
39         $this->assertContains($needle, $bean->body_html);
40     }
41
42     static public function dataProvider()
43     {
44         return array(
45             array(
46                 '<a href="{::test::}">test</a>',
47                 '{::test::}'
48             )
49         );
50     }
51 }