Follow-up to bug #10769: Added unit tests for t3lib_div::encodeHeader()
authorOliver Hader <oliver.hader@typo3.org>
Sun, 2 Aug 2009 08:22:39 +0000 (08:22 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 2 Aug 2009 08:22:39 +0000 (08:22 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5751 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
tests/t3lib/t3lib_div_testcase.php

index 367996e..3ff8d5e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed bug #11585: Faulty usage of t3lib_matchCondition in backend template
        * Follow-up to bug #11585: Added unit test for t3lib_matchCondition
        * Fixed bug #10769: Wrong encoded email header (thanks to Ivan Kartolo)
+       * Follow-up to bug #10769: Added unit tests for t3lib_div::encodeHeader()
 
 2009-08-02  Christian Kuhn  <lollli@schwarzbu.ch>
 
index 693baf2..1fd5e86 100644 (file)
@@ -170,6 +170,36 @@ class t3lib_div_testcase extends tx_phpunit_testcase {
                $this->assertEquals('blogExample', t3lib_div::lcfirst('BlogExample'));
                $this->assertEquals('blogexample', t3lib_div::lcfirst('blogexample'));
        }
+
+       /**
+        * Tests whether whitespaces are encoded correctly in a quoted-printable mail header.
+        * @test
+        */
+       public function areWhitespacesEncodedInQuotedPrintableMailHeader() {
+               $this->assertEquals(
+                       '=?utf-8?Q?We_test_whether_the_copyright_character_=C2=A9_is_encoded_correctly?=',
+                       t3lib_div::encodeHeader(
+                               "We test whether the copyright character \xc2\xa9 is encoded correctly",
+                               'quoted-printable',
+                               'utf-8'
+                       )
+               );
+       }
+
+       /**
+        * Tests whether question marks are encoded correctly in a quoted-printable mail header.
+        * @test
+        */
+       public function areQuestionMarksEncodedInQuotedPrintableMailHeader() {
+               $this->assertEquals(
+                       '=?utf-8?Q?Is_the_copyright_character_=C2=A9_really_encoded_correctly=3F_Really=3F?=',
+                       t3lib_div::encodeHeader(
+                               "Is the copyright character \xc2\xa9 really encoded correctly? Really?",
+                               'quoted-printable',
+                               'utf-8'
+                       )
+               );
+       }
 }
 
 ?>
\ No newline at end of file