From a32679e69f7d6c265f85015677743272740dcc8e Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 12 Jan 2011 15:54:35 +0000 Subject: Unlinked externals, removed development stuff and updated versions --- tests/html_to_text.php | 46 ----------------- tests/maildecode.php | 63 ---------------------- tests/mailfunc.php | 135 ------------------------------------------------ tests/modcss.php | 45 ---------------- tests/runtests.sh | 54 ------------------- tests/src/BID-26800.txt | 52 ------------------- tests/src/apple.vcf | 49 ------------------ tests/src/htmlbody.txt | 51 ------------------ tests/src/htmlxss.txt | 22 -------- tests/src/johndoe.vcf | 11 ---- tests/src/mailto.txt | 8 --- tests/src/plainbody.txt | 38 -------------- tests/src/thebat.vcf | 8 --- tests/src/valid.css | 30 ----------- tests/vcards.php | 57 -------------------- 15 files changed, 669 deletions(-) delete mode 100644 tests/html_to_text.php delete mode 100644 tests/maildecode.php delete mode 100644 tests/mailfunc.php delete mode 100644 tests/modcss.php delete mode 100755 tests/runtests.sh delete mode 100644 tests/src/BID-26800.txt delete mode 100644 tests/src/apple.vcf delete mode 100644 tests/src/htmlbody.txt delete mode 100644 tests/src/htmlxss.txt delete mode 100644 tests/src/johndoe.vcf delete mode 100644 tests/src/mailto.txt delete mode 100644 tests/src/plainbody.txt delete mode 100644 tests/src/thebat.vcf delete mode 100644 tests/src/valid.css delete mode 100644 tests/vcards.php (limited to 'tests') diff --git a/tests/html_to_text.php b/tests/html_to_text.php deleted file mode 100644 index c1d40d930..000000000 --- a/tests/html_to_text.php +++ /dev/null @@ -1,46 +0,0 @@ -UnitTestCase("HTML-to-Text conversion tests"); - - } - - function test_html2text() - { - $data = array( - 0 => array( - 'title' => 'Test entry', - 'in' => '', - 'out' => '', - ), - 1 => array( - 'title' => 'Basic HTML entities', - 'in' => '"&', - 'out' => '"&', - ), - 2 => array( - 'title' => 'HTML entity string', - 'in' => '"', - 'out' => '"', - ), - ); - - $ht = new html2text(null, false, false); - - foreach ($data as $item) { - $ht->set_html($item['in']); - $res = $ht->get_text(); - $this->assertEqual($item['out'], $res, $item['title']); - } - } - -} diff --git a/tests/maildecode.php b/tests/maildecode.php deleted file mode 100644 index cfd7eda2f..000000000 --- a/tests/maildecode.php +++ /dev/null @@ -1,63 +0,0 @@ -UnitTestCase('Mail headers decoding tests'); - - $this->app = rcmail::get_instance(); - $this->app->imap_init(false); - } - - /** - * Test decoding of single e-mail address strings - * Uses rcube_imap::decode_address_list() - */ - function test_decode_single_address() - { - $headers = array( - 0 => 'test@domain.tld', - 1 => '', - 2 => 'Test ', - 3 => 'Test Test ', - 4 => 'Test Test', - 5 => '"Test Test" ', - 6 => '"Test Test"', - 7 => '"Test \\" Test" ', - 8 => '"Test', - 9 => '=?ISO-8859-1?B?VGVzdAo=?= ', - 10 => '=?ISO-8859-1?B?VGVzdAo=?=', // #1487068 - ); - - $results = array( - 0 => array('', 'test@domain.tld'), - 1 => array('', 'test@domain.tld'), - 2 => array('Test', 'test@domain.tld'), - 3 => array('Test Test', 'test@domain.tld'), - 4 => array('Test Test', 'test@domain.tld'), - 5 => array('Test Test', 'test@domain.tld'), - 6 => array('Test Test', 'test@domain.tld'), - 7 => array('Test " Test', 'test@domain.tld'), - 8 => array('Test array('Test', 'test@domain.tld'), - 10 => array('Test', 'test@domain.tld'), - ); - - foreach ($headers as $idx => $header) { - $res = $this->app->imap->decode_address_list($header); - - $this->assertEqual(1, count($res), "Rows number in result for header: " . $header); - $this->assertEqual($results[$idx][0], $res[1]['name'], "Name part decoding for header: " . $header); - $this->assertEqual($results[$idx][1], $res[1]['mailto'], "Name part decoding for header: " . $header); - } - } - -} diff --git a/tests/mailfunc.php b/tests/mailfunc.php deleted file mode 100644 index cc26f7743..000000000 --- a/tests/mailfunc.php +++ /dev/null @@ -1,135 +0,0 @@ -UnitTestCase('Mail body rendering tests'); - - // simulate environment to successfully include func.inc - $GLOBALS['RCMAIL'] = $RCMAIL = rcmail::get_instance(); - $GLOBALS['OUTPUT'] = $OUTPUT = $RCMAIL->load_gui(); - $RCMAIL->action = 'autocomplete'; - $RCMAIL->imap_init(false); - $IMAP = $RCMAIL->imap; - - require_once 'steps/mail/func.inc'; - - $GLOBALS['EMAIL_ADDRESS_PATTERN'] = $EMAIL_ADDRESS_PATTERN; - } - - /** - * 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->assertPattern('/src="'.$part->replaces['ex1.jpg'].'"/', $html, "Replace reference to inline image"); - $this->assertPattern('#background="./program/blocked.gif"#', $html, "Replace external background image"); - $this->assertNoPattern('/ex3.jpg/', $html, "No references to external images"); - $this->assertNoPattern('/]+>/', $html, "No meta tags allowed"); - //$this->assertNoPattern('/ - - -

2 test

-

<div> block

-
valid css
-
-
- -

3 test

-

Inject comment text

-
-
- -

4 test

-

Using reverse solid to directe the codepoint

-
-
- -

5 test

-

Character entity references

-

Character entity references is acceptable in "inline styles"

-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- - - - diff --git a/tests/src/apple.vcf b/tests/src/apple.vcf deleted file mode 100644 index 856eaf328..000000000 --- a/tests/src/apple.vcf +++ /dev/null @@ -1,49 +0,0 @@ -BEGIN:VCARD -VERSION:3.0 -N:;;;; -FN:Apple Computer AG -ORG:Apple Computer AG; -item1.ADR;type=WORK;type=pref:;;Birgistrasse 4a;Wallisellen-Zürich;;8304;Switzerland -item1.X-ABADR:ch -item2.URL;type=pref:http\://www.apple.ch -item2.X-ABLabel:_$!!$_ -PHOTO;BASE64: - /9j/4AAQSkZJRgABAQAAAQABAAD/7QAcUGhvdG9zaG9wIDMuMAA4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NADuuQR24KuqU3GTtCpbXtLo32T2b9GcWNw7qwU4q84X06yi9Wl531XfXyPxK - ME4nNsYZRciUwG3MbicTh/LMJix5glD/ACGPbv3/AC4zxXtniFvUNJ1XSmjXVNM1DTWmUvCuoWVz - ZtKgxloxcRxmRRkZZcgZGTzSTT2afo7hqtz6w/ZB+BV78UPHtl4n1eykHgfwdewajfXE0bCDVtVt - mE+n6PAzAJOBOkdxqAUssdsnlSDNwoPLi66pU3FP95NNJdk95P06d35XOvCUHWqJtfu4NOT7vdR8 - 7vfsvVH7gV4R7oUAFAHKReA/A8Gsy+IofBnhSHxBO7ST67F4d0iPWZnb7zy6mlmL2R2/iZ5yT3NX - 7Spbl9pPl/l55W+69iPZUubm9nDmvfm5I81+97XuX9a8MeGvEtsLLxF4e0PX7MMGFprWk2Gq2wZe - jCC+t54tw7HZkdqUZzg7wlKL7xk4v700OUIT0lCMl2lFS/NMuaXpOlaHZQ6Zoumafo+nW4It9P0u - yttPsoATkiG1tI4oIgTyQkagnmk5Sk7ybk+7bb+96jjGMVaMVFdopJfcjQpDP//Z -X-ABShowAs:COMPANY -X-ABUID:2E4CB084-4767-4C85-BBCA-805B1DCB1C8E\:ABPerson -END:VCARD diff --git a/tests/src/htmlbody.txt b/tests/src/htmlbody.txt deleted file mode 100644 index 66286e61d..000000000 --- a/tests/src/htmlbody.txt +++ /dev/null @@ -1,51 +0,0 @@ - - - - -Roundcube Test Message - - - - - - - - - -
- -

This is a HTML message

- -

See nice pictures like the following:

- -
- Example 1 - Example 2 - Example 3 -
- -
-

Subscription form

- - E-Mail:
- - -
- -

To unsubscribe click here or - send a mail to unsubscribe@evilsite.net

- -
- - - \ No newline at end of file diff --git a/tests/src/htmlxss.txt b/tests/src/htmlxss.txt deleted file mode 100644 index f6c43e353..000000000 --- a/tests/src/htmlxss.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -

- -

mail me! -roundcube.net -roundcube.net (2) - -

- -
Brilliant!
- -
BBBBBB
- -

-Have a nice Christmas time.
-Thomas -

- - - diff --git a/tests/src/johndoe.vcf b/tests/src/johndoe.vcf deleted file mode 100644 index 67b649df3..000000000 --- a/tests/src/johndoe.vcf +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:VCARD -VERSION:2.1 -N;CHARSET=windows-1252:Doë;John;;; -FN;CHARSET=windows-1252:John Doë -ORG:roundcube.net; -EMAIL;INTERNET;WORK:inbox@roundcube.net -EMAIL;INTERNET;HOME;TYPE=pref:roundcube@gmail.com -TEL;WORK:+123456789 -ADR;WORK:;;The street;Hometown;;5555;Cayman Islands -NOTE:The notes... -END:VCARD diff --git a/tests/src/mailto.txt b/tests/src/mailto.txt deleted file mode 100644 index e70b12de8..000000000 --- a/tests/src/mailto.txt +++ /dev/null @@ -1,8 +0,0 @@ - - - - -e-mail - - - \ No newline at end of file diff --git a/tests/src/plainbody.txt b/tests/src/plainbody.txt deleted file mode 100644 index 7fba94f86..000000000 --- a/tests/src/plainbody.txt +++ /dev/null @@ -1,38 +0,0 @@ -From: iPhone Developer Program -To: nobody@roundcube.net - -*iPhone Developer Program* - ------------------------------------ -iPhone SDK 2.2.1 is now available -https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?appIdKey=3D= -D635F5C417E087A3B9864DAC5D25920C4E9442C9339FA9277951628F0291F620&path=3D//i= -phone/login.action - -Log in to the iPhone Dev Center to download iPhone SDK for iPhone OS 2.2.1.= - Installation of iPhone SDK 2.2.1 is required for development with devices = -updated to iPhone OS 2.2.1. Please view the Read Me before installing the n= -ew version of the iPhone SDK. - -Log in now -https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?appIdKey=3D= -D635F5C417E087A3B9864DAC5D25920C4E9442C9339FA9277951628F0291F620&path=3D//i= -phone/login.action - ------------------------------------ -Copyright (c) 2009 Apple Inc. 1 Infinite Loop, MS 303-3DM, Cupertino, CA 95= -014. - -All Rights Reserved -http://www.apple.com/legal/default.html - -Keep Informed -http://www.apple.com/enews/subscribe/ - -Privacy Policy -http://www.apple.com/legal/privacy. - -My Info -https://myinfo.apple.com/cgi-bin/WebObjects/MyInfo - --[http://example.com/?tx[a]=5]- diff --git a/tests/src/thebat.vcf b/tests/src/thebat.vcf deleted file mode 100644 index 8179f788d..000000000 --- a/tests/src/thebat.vcf +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN:VCARD -VERSION:2.1 -N;ENCODING=QUOTED-PRINTABLE:Iksi=F1ski;Piotr -FN;ENCODING=QUOTED-PRINTABLE:Piotr Iksi=F1ski -EMAIL;PREF;INTERNET:piotr.iksinski@somedomain.com -X-GENDER:Male -REV:20080716T203548Z -END:VCARD diff --git a/tests/src/valid.css b/tests/src/valid.css deleted file mode 100644 index 340fa9a87..000000000 --- a/tests/src/valid.css +++ /dev/null @@ -1,30 +0,0 @@ -/** Master style definitions **/ - -body, p, div, h1, h2, h3, textarea { - font-family: "Lucida Grande", Helvetica, sans-serif; - font-size: 8.8pt; - color: #333; -} - -body { - background-color: white; - margin: 0; -} - -h1 { - color: #1F519A; - font-size: 1.7em; - font-weight: normal; - margin-top: 0; - margin-bottom: 1em; -} - -.noscript { - display: none; -} - -.hint, .username { - color: #999; -} - - diff --git a/tests/vcards.php b/tests/vcards.php deleted file mode 100644 index 3b8f260c4..000000000 --- a/tests/vcards.php +++ /dev/null @@ -1,57 +0,0 @@ -UnitTestCase('Vcard encoding/decoding tests'); - } - - function _srcpath($fn) - { - return realpath(dirname(__FILE__) . '/src/' . $fn); - } - - function test_parse_one() - { - $vcard = new rcube_vcard(file_get_contents($this->_srcpath('apple.vcf'))); - - $this->assertEqual(true, $vcard->business, "Identify as business record"); - $this->assertEqual("Apple Computer AG", $vcard->displayname, "FN => displayname"); - $this->assertEqual("", $vcard->firstname, "No person name set"); - } - - function test_parse_two() - { - $vcard = new rcube_vcard(file_get_contents($this->_srcpath('johndoe.vcf')), null); - - $this->assertEqual(false, $vcard->business, "Identify as private record"); - $this->assertEqual("John Doë", $vcard->displayname, "Decode according to charset attribute"); - $this->assertEqual("roundcube.net", $vcard->organization, "Test organization field"); - $this->assertEqual(2, count($vcard->email), "List two e-mail addresses"); - $this->assertEqual("roundcube@gmail.com", $vcard->email[0], "Use PREF e-mail as primary"); - } - - function test_import() - { - $input = file_get_contents($this->_srcpath('apple.vcf')); - $input .= file_get_contents($this->_srcpath('johndoe.vcf')); - - $vcards = rcube_vcard::import($input); - - $this->assertEqual(2, count($vcards), "Detected 2 vcards"); - $this->assertEqual("Apple Computer AG", $vcards[0]->displayname, "FN => displayname"); - $this->assertEqual("John Doë", $vcards[1]->displayname, "Displayname with correct charset"); - - // http://trac.roundcube.net/ticket/1485542 - $vcards2 = rcube_vcard::import(file_get_contents($this->_srcpath('thebat.vcf'))); - $this->assertEqual("Iksiñski", $vcards2[0]->surname, "Detect charset in encoded values"); - } - -} -- cgit v1.2.3