]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/modules/InboundEmail/Bug44009Test.php
Release 6.1.6
[Github/sugarcrm.git] / tests / modules / InboundEmail / Bug44009Test.php
1 <?php
2 require_once('modules/InboundEmail/InboundEmail.php');
3
4 /**
5  * @ticket 44009
6  */
7 class Bug44009Test extends Sugar_PHPUnit_Framework_TestCase
8 {
9
10         protected $ie = null;
11
12         public function setUp()
13     {
14                 $this->ie = new InboundEmail();
15         }
16
17     public function getData()
18     {
19         return array(
20             array("test<b>test</b>", "test<b>test</b>"),
21             array("<html>test<b>test</b></html>", "test<b>test</b>"),
22             array("<html><head></head><body>test<b>test</b></body></html>", "test<b>test</b>"),
23             array("<html><head><style>test</style></head><body>test<b>test</b></body></html>", "test<b>test</b>"),
24             array("<html><head></head><body><script language=\"javascript\">alert('test!');</script>test<b>test</b></body></html>", "test<b>test</b>"),
25             array("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" /><title>test 12345</title></head><body><p>test<b>test</b></body></html>", "<p>test<b>test</b></p>"),
26             );
27     }
28
29     /**
30      * @dataProvider getData
31      * @param string $url
32      */
33         function testEmailCleanup($data, $res)
34         {
35         $this->assertEquals($res,$this->ie->cleanContent($data));
36         }
37 }