コード例 #1
0
ファイル: XssTest.php プロジェクト: nickpro/sugarcrm_dev
 /**
  * @dataProvider xssData
  */
 public function testXssFilterBean($before, $after)
 {
     $bean = new EmailTemplate();
     $bean->body_html = to_html($before);
     $bean->cleanBean();
     $this->assertEquals(to_html($after), $bean->body_html);
 }
コード例 #2
0
ファイル: Bug60152Test.php プロジェクト: delkyd/sugarcrm_dev
 /**
  * Test asserts that body_html has variables after cleanBean call
  *
  * @group 60152
  * @dataProvider dataProvider
  * @return void
  */
 public function testCleanBean($html, $needle)
 {
     $bean = new EmailTemplate();
     $bean->body_html = $html;
     $bean->cleanBean();
     $this->assertContains($needle, $bean->body_html);
 }
コード例 #3
0
 public function testcleanBean()
 {
     $emailTemplate = new EmailTemplate();
     //test without body_html attribute
     $emailTemplate->cleanBean();
     $this->assertEquals('', $emailTemplate->body_html);
     //test with body_html attribute
     $emailTemplate->body_html = '<h1>text</h1>';
     $emailTemplate->cleanBean();
     $this->assertEquals('&lt;h1&gt;text&lt;/h1&gt;', $emailTemplate->body_html);
 }