From 8c893b79d230cc844226bdf3b1de95cd5a99ecb2 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 30 Jan 2014 09:12:57 +0100 Subject: Branching off for release 1.0 --- tests/MailFunc.php | 268 ----------------------------------------------------- 1 file changed, 268 deletions(-) delete mode 100644 tests/MailFunc.php (limited to 'tests/MailFunc.php') diff --git a/tests/MailFunc.php b/tests/MailFunc.php deleted file mode 100644 index ab0074ef2..000000000 --- a/tests/MailFunc.php +++ /dev/null @@ -1,268 +0,0 @@ -load_gui(); - $RCMAIL->action = 'autocomplete'; - $RCMAIL->storage_init(false); - - require_once INSTALL_PATH . 'program/steps/mail/func.inc'; - } - - /** - * Helper method to create a HTML message part object - */ - function get_html_part($body) - { - $part = new rcube_message_part; - $part->ctype_primary = 'text'; - $part->ctype_secondary = 'html'; - $part->body = file_get_contents(TESTS_DIR . $body); - $part->replaces = array(); - return $part; - } - - - /** - * Test sanitization of a "normal" html message - */ - function test_html() - { - $part = $this->get_html_part('src/htmlbody.txt'); - $part->replaces = array('ex1.jpg' => 'part_1.2.jpg', 'ex2.jpg' => 'part_1.2.jpg'); - - // render HTML in normal mode - $html = rcmail_html4inline(rcmail_print_body($part, array('safe' => false)), 'foo'); - - $this->assertRegExp('/src="'.$part->replaces['ex1.jpg'].'"/', $html, "Replace reference to inline image"); - $this->assertRegExp('#background="./program/resources/blocked.gif"#', $html, "Replace external background image"); - $this->assertNotRegExp('/ex3.jpg/', $html, "No references to external images"); - $this->assertNotRegExp('/]+>/', $html, "No meta tags allowed"); - //$this->assertNoPattern('/