/** * @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); }
/** * 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); }
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('<h1>text</h1>', $emailTemplate->body_html); }