Convert the rest of Text_Filter tests to PHPUnit.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Jul 2010 18:16:58 +0000 (12:16 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 22 Jul 2010 19:25:38 +0000 (13:25 -0600)
15 files changed:
framework/Text_Filter/package.xml
framework/Text_Filter/test/Horde/Text/Filter/EmailsTest.php [new file with mode: 0644]
framework/Text_Filter/test/Horde/Text/Filter/EnvironmentTest.php [new file with mode: 0644]
framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php [new file with mode: 0644]
framework/Text_Filter/test/Horde/Text/Filter/Space2htmlTest.php [new file with mode: 0644]
framework/Text_Filter/test/Horde/Text/Filter/Text2htmlTest.php [new file with mode: 0644]
framework/Text_Filter/test/Horde/Text/Filter/emails.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/environment.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/fixtures/html2text.html [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/fixtures/text2html.txt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/html2text.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/html2text2.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/html2text3.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/space2html.phpt [deleted file]
framework/Text_Filter/test/Horde/Text/Filter/text2html.phpt [deleted file]

index 201d436..62a4fd8 100644 (file)
@@ -87,20 +87,15 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <dir name="Horde">
      <dir name="Text">
       <dir name="Filter">
-       <dir name="fixtures">
-        <file name="html2text.html" role="test" />
-        <file name="text2html.txt" role="test" />
-       </dir> <!-- /test/Horde/Text/Filter/fixtures -->
        <file name="AllTests.php" role="test" />
        <file name="Autoload.php" role="test" />
+       <file name="Emails.php" role="test" />
+       <file name="EnvironmentTest.php" role="test" />
+       <file name="Html2textTest.php" role="test" />
+       <file name="Space2htmlTest.php" role="test" />
+       <file name="Text2htmlTest.php" role="test" />
        <file name="XssTest.php" role="test" />
-       <file name="emails.phpt" role="test" />
-       <file name="environment.phpt" role="test" />
-       <file name="html2text.phpt" role="test" />
-       <file name="html2text2.phpt" role="test" />
        <file name="phpunit.xml" role="test" />
-       <file name="space2html.phpt" role="test" />
-       <file name="text2html.phpt" role="test" />
       </dir> <!-- /test/Horde/Text/Filter -->
      </dir> <!-- /test/Horde/Text -->
     </dir> <!-- /test/Horde -->
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/EmailsTest.php b/framework/Text_Filter/test/Horde/Text/Filter/EmailsTest.php
new file mode 100644 (file)
index 0000000..583163d
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Horde_Text_Filter_Emails tests.
+ *
+ * @author     Michael Slusarz <slusarz@horde.org>
+ * @category   Horde
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package    Text_Filter
+ * @subpackage UnitTests
+ */
+
+class Horde_Text_Filter_EmailsTest extends PHPUnit_Framework_TestCase
+{
+    public function testEmails()
+    {
+        $tests = array(
+            'Inline address test@example.com test.' => 'Inline address <a class="pagelink" href="mailto:test@example.com">test@example.com</a> test.',
+            'Inline protocol mailto: test@example.com test with whitespace.' => 'Inline protocol mailto: <a class="pagelink" href="mailto:test@example.com">test@example.com</a> test with whitespace.',
+            'Inline Outlook [mailto:test@example.com] test.' => 'Inline Outlook [mailto:<a class="pagelink" href="mailto:test@example.com">test@example.com</a>] test.',
+            'Inline angle brackets <test@example.com> test.' => 'Inline angle brackets <<a class="pagelink" href="mailto:test@example.com">test@example.com</a>> test.',
+            'Inline angle brackets (HTML) &lt;test@example.com&gt; test.' => 'Inline angle brackets (HTML) &lt;<a class="pagelink" href="mailto:test@example.com">test@example.com</a>&gt; test.',
+            'Inline angle brackets with mailto &lt;mailto:test@example.com&gt; test.' => 'Inline angle brackets with mailto &lt;mailto:<a class="pagelink" href="mailto:test@example.com">test@example.com</a>&gt; test.',
+            'Inline with parameters test@example.com?subject=A%20subject&body=The%20message%20body test.' => 'Inline with parameters <a class="pagelink" href="mailto:test@example.com?subject=A%20subject&amp;body=The%20message%20body">test@example.com?subject=A%20subject&amp;body=The%20message%20body</a> test.',
+            'Inline protocol with parameters mailto:test@example.com?subject=A%20subject&body=The%20message%20body test.' => 'Inline protocol with parameters mailto:<a class="pagelink" href="mailto:test@example.com?subject=A%20subject&amp;body=The%20message%20body">test@example.com?subject=A%20subject&amp;body=The%20message%20body</a> test.',
+            'test@example.com in front test.' => '<a class="pagelink" href="mailto:test@example.com">test@example.com</a> in front test.',
+            'At end test of test@example.com' => 'At end test of <a class="pagelink" href="mailto:test@example.com">test@example.com</a>',
+            'Don\'t link http://test@www.horde.org/ test.' => 'Don\'t link http://test@www.horde.org/ test.',
+            'Real world example: mailto:pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&body=%5b%23ptn6Pw-1%5d' => 'Real world example: mailto:<a class="pagelink" href="mailto:pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&amp;body=%5b%23ptn6Pw-1%5d">pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&amp;body=%5b%23ptn6Pw-1%5d</a>'
+        );
+
+        foreach ($tests as $key => $val) {
+            $filter = Horde_Text_Filter::filter($key, 'emails', array(
+                'class' => 'pagelink'
+            ));
+            $this->assertEquals($val, $filter);
+        }
+    }
+
+}
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/EnvironmentTest.php b/framework/Text_Filter/test/Horde/Text/Filter/EnvironmentTest.php
new file mode 100644 (file)
index 0000000..0a86ac0
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Horde_Text_Filter_Environment tests.
+ *
+ * @author     Michael Slusarz <slusarz@horde.org>
+ * @category   Horde
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package    Text_Filter
+ * @subpackage UnitTests
+ */
+
+class Horde_Text_Filter_EnvironmentTest extends PHPUnit_Framework_TestCase
+{
+    public function testEnvironment()
+    {
+        $tests = array(
+            'Simple line' => 'Simple line',
+            'Inline %FOO% variable' => 'Inline bar variable',
+            '%FOO% at start' => 'bar at start',
+            'at end %FOO%' => 'at end bar',
+            '# %COMMENT% line' => '',
+            'Variable %FOO% with # comment %COMMENT%' => 'Variable bar with ',
+            'Simple line' => 'Simple line'
+        );
+
+        putenv('COMMENT=comment');
+        putenv('FOO=bar');
+
+        foreach ($tests as $key => $val) {
+            $filter = Horde_Text_Filter::filter($key, 'environment');
+            $this->assertEquals($val, $filter);
+        }
+    }
+
+}
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php b/framework/Text_Filter/test/Horde/Text/Filter/Html2textTest.php
new file mode 100644 (file)
index 0000000..0a71c2f
--- /dev/null
@@ -0,0 +1,448 @@
+<?php
+/**
+ * Horde_Text_Filter_Html2text tests.
+ *
+ * @author     Michael Slusarz <slusarz@horde.org>
+ * @category   Horde
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package    Text_Filter
+ * @subpackage UnitTests
+ */
+
+class Horde_Text_Filter_Html2textTest extends PHPUnit_Framework_TestCase
+{
+    public function testHtml2textVarious()
+    {
+        $html = <<<EOT
+<h2>Inline Formatting</h2>
+
+    Some text with leading and trailing whitespace  
+
+<br />
+
+<hr />
+
+<h2>Table</h2>
+
+<table class="table">
+    <tr>
+        <th>Type</th>
+        <th>Representation</th>
+    </tr>
+    <tr>
+        <td class="table-cell">emphasis text</td>
+        <td class="table-cell"><em>emphasis text</em></td>
+    </tr>
+    <tr>
+        <td class="table-cell">strong text</td>
+        <td class="table-cell"><strong>strong text</strong></td>
+    </tr>
+    <tr>
+        <td class="table-cell">italic text</td>
+        <td class="table-cell"><i>italic text</i></td>
+    </tr>
+    <tr>
+        <td class="table-cell">bold text</td>
+        <td class="table-cell"><b>bold text</b></td>
+    </tr>
+    <tr>
+        <td class="table-cell">emphasis and strong</td>
+        <td class="table-cell"><em><strong>emphasis and strong</strong></em></td>
+    </tr>
+    <tr>
+        <td class="table-cell">underline text</td>
+        <td class="table-cell"><u>underline text</u></td>
+    </tr>
+</table>
+
+<hr />
+
+
+<h2>Links</h2>
+<a href="http://www.horde.org">Horde Homepage</a><br />
+<a href="mailto:test@example.com">Test User</a><br />
+Some inline <a href="http://www.horde.org">link</a>.<br />
+<a href="http://www.example.com">http://www.example.com</a><br />
+
+<hr />
+
+
+<h2>Headings</h2>
+<p>You can make various levels of heading by putting equals-signs before and
+after the text (all on its own line):</p>
+
+<h3>level 3 heading</h3>
+<h4>level 4 heading</h4>
+
+<h5>level 5 heading</h5>
+<h6>level 6 heading</h6>
+
+<hr />
+
+
+<h3>Bullet Lists</h3>
+<p>You can create bullet lists by starting a paragraph with one or more
+asterisks.</p>
+
+<ul>
+    <li>Bullet one<ul>
+        <li>Sub-bullet</li>
+    </ul></li>
+</ul>
+
+<h3>Numbered Lists</h3>
+<p>Similarly, you can create numbered lists by starting a paragraph with one
+or more hashes.</p>
+
+<ol>
+    <li>Numero uno</li>
+    <li>Number two<ol>
+        <li>Sub-item</li>
+    </ol></li>
+
+</ol>
+
+<h3>Mixing Bullet and Number List Items</h3>
+<p>You can mix and match bullet and number lists:</p>
+
+<ol>
+    <li>Number one<ul>
+        <li>Bullet</li>
+        <li>Bullet</li>
+    </ul></li>
+    <li>Number two<ul>
+        <li>Bullet</li>
+        <li>Bullet<ul>
+            <li>Sub-bullet<ol>
+                <li>Sub-sub-number</li>
+                <li>Sub-sub-number</li>
+            </ol></li>
+        </ul></li>
+    </ul></li>
+    <li>Number three<ul>
+        <li>Bullet</li>
+        <li>Bullet</li>
+    </ul></li>
+</ol>
+
+
+<h2>Block quoting</h2>
+<blockquote type="cite">
+<a href="http://www.horde.org">Horde Homepage</a><br />
+Some inline <a href="http://www.horde.org">link</a>.<br />
+</blockquote>
+
+Line inbetween.
+
+<blockquote type="cite">
+<h2>Heading inside quoting</h2>
+<p>This is a paragraph inside a block quoting. The result should be several
+lines prefixed with the &gt; character.</p>
+</blockquote>
+
+
+<h2>Special Characters</h2>
+
+<div>
+&auml;
+&eacute;
+&copy;
+&trade;
+&#x0110;
+</div>
+
+<p>Zitat von John Doe &lt;john.doe@example.com&gt;:</p>
+  <blockquote type="cite"> 
+    <div class="Section1"> 
+      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Hallo lieber John,<o:p /></span></font></p> 
+      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p> 
+      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Blah, blah.'<o:p /></span></font></p> 
+      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p> 
+      <p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-GB" style="font-size: 12pt;"><o:p> </o:p></span></font></p> 
+    </div> 
+  </blockquote> 
+  <p> </p>
+  <p class="imp-signature"><!--begin_signature-->-- <br />
+Some signature<br /><a target="_blank" href="http://www.example.com">http://www.example.com</a><!--end_signature--></p>
+
+<p>Zitat von Jane Doe &lt;jane.doe@example.com&gt;:</p>
+  <blockquote type="cite">
+Jan Schneider a écrit&nbsp;:
+
+    <blockquote type="cite" cite="mid:20081007135151.190315kzjzymtbhc@neo.wg.de">Zitat von Jane Doe
+<a href="mailto:jane.doe@example.com" class="moz-txt-link-rfc2396E">&lt;jane.doe@example.com&gt;</a>:
+  <br /> <br /> 
+      <blockquote type="cite">Hi,
+    <br /> <br />
+I prepare the last &quot;horde-webmail-1.2&quot; for production level but I have
+few questions:
+    <br />
+- is there a way to disable &quot;external_display_cal&quot; in kronolith, I
+don't want seeing birthdays calendars (turba) and task list (nag)
+    <br /> </blockquote> <br />
+They aren't displayed by default, or do you mean you don't want them to
+appear in the top right calendar panel?
+  <br /> 
+    </blockquote>
+Yes I don't want them to appear in the top right calendar panel but I
+want user can create their external_cal<br />
+  </blockquote><br />
+  <p class="imp-signature"><!--begin_signature-->Jan.<br /> <br />
+-- <br />
+Do you need professional PHP or Horde consulting?<br /> <a target="_blank" href="http://horde.org/consulting/">http://horde.org/consulting/</a><!--end_signature--></p>
+EOT;
+
+        $text = <<<EOT
+INLINE FORMATTING
+
+Some text with leading and trailing whitespace
+
+-------------------------
+
+TABLE
+
+  TYPE         REPRESENTATION
+  emphasis text        /emphasis text/
+  strong text  STRONG TEXT
+  italic text  /italic text/
+  bold text    BOLD TEXT
+  emphasis and strong  /EMPHASIS AND STRONG/
+  underline text       _underline text_
+
+-------------------------
+
+LINKS
+
+Horde Homepage[1]
+Test User[2]
+Some inline link[1].
+http://www.example.com
+
+-------------------------
+
+HEADINGS
+
+You can make various levels of heading by putting equals-signs before
+and after the text (all on its own line):
+
+LEVEL 3 HEADING
+
+Level 4 Heading
+
+Level 5 Heading
+
+Level 6 Heading
+
+-------------------------
+
+BULLET LISTS
+
+You can create bullet lists by starting a paragraph with one or more
+asterisks.
+
+  * Bullet one
+
+    * Sub-bullet
+
+NUMBERED LISTS
+
+Similarly, you can create numbered lists by starting a paragraph with
+one or more hashes.
+
+  * Numero uno
+  * Number two
+
+    * Sub-item
+
+MIXING BULLET AND NUMBER LIST ITEMS
+
+You can mix and match bullet and number lists:
+
+  * Number one
+
+    * Bullet
+    * Bullet
+
+  * Number two
+
+    * Bullet
+    * Bullet
+
+      * Sub-bullet
+
+        * Sub-sub-number
+        * Sub-sub-number
+
+  * Number three
+
+    * Bullet
+    * Bullet
+
+BLOCK QUOTING
+
+> Horde Homepage[1]
+>  Some inline link[1].
+
+Line inbetween.
+
+> HEADING INSIDE QUOTING
+>
+>
+> This is a paragraph inside a block quoting. The result should be
+> several lines prefixed with the > character.
+
+SPECIAL CHARACTERS
+
+ä é © ™ Đ
+
+Zitat von John Doe <john.doe@example.com>:
+
+> Hallo lieber John,
+>
+> Blah, blah.'
+
+--
+ Some signature
+http://www.example.com
+
+Zitat von Jane Doe <jane.doe@example.com>:
+
+> Jan Schneider a écrit :
+> > Zitat von Jane Doe <jane.doe@example.com>[3]:
+> > > Hi,
+> > >
+> > >  I prepare the last "horde-webmail-1.2" for production level but
+> > > I have few questions:
+> > >  - is there a way to disable "external_display_cal" in
+> > > kronolith, I don't want seeing birthdays calendars (turba) and
+> > > task list (nag)
+> >  They aren't displayed by default, or do you mean you don't want
+> > them to appear in the top right calendar panel?
+>  Yes I don't want them to appear in the top right calendar panel but
+> I want user can create their external_cal
+
+Jan.
+
+ --
+ Do you need professional PHP or Horde consulting?
+http://horde.org/consulting/
+
+
+Links:
+------
+[1] http://www.horde.org
+[2] mailto:test@example.com
+[3] mailto:jane.doe@example.com
+EOT;
+
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
+            'charset' => 'UTF-8',
+            'width' => 70
+        ));
+
+        $this->assertEquals($text, $filter);
+    }
+
+    public function testHtml2textLinks()
+    {
+        $html = <<<EOT
+<ul>
+  <li>This is a short line.</li>
+  <li>This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line.</li>
+  <li>And again a short line.</li>
+</ul>
+EOT;
+
+        $text_wrap = <<<EOT
+  * This is a short line.
+  * This is a long line. This is a long line. This
+is a long line. This is a long line. This is a
+long line. This is a long line. This is a long
+line. This is a long line. This is a long line.
+This is a long line. This is a long line. This is
+a long line.
+  * And again a short line.
+EOT;
+
+        $text_nowrap = <<<EOT
+  * This is a short line.
+  * This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line.
+  * And again a short line.
+EOT;
+
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
+            'width' => 50
+        ));
+        $this->assertEquals($text_wrap, $filter);
+
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
+            'width' => 0
+        ));
+        $this->assertEquals($text_nowrap, $filter);
+    }
+
+    public function testHtml2textQuoting()
+    {
+        $html = <<<EOT
+<p>Zitat von Roberto Maurizzi &lt;roberto.maurizzi@gmail.com&gt;:</p>
+  <blockquote type="cite">
+    <div class="gmail_quote">
+      <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
+        <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"> 
+          <div class="Ih2E3d">
+            <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">4) In Turba, I can select a VFS driver to use. Currently it is set to<br />
+
+None and turba seems to be working fine. What does Turba use the VFS<br />
+for?<br /> </blockquote> 
+          </div>
+        </blockquote><br />
+You can attach files to contacts with that.<br /> <br />
+Jan.<br /><font color="#888888"> </font>
+      </blockquote>
+      <div><br /></div>
+    </div>Anything similar for Kronolith, maybe in the new version?<br />I've googled a little and only found a discussion in 2004 about having attachment (or links) from VFS in Kronolith.<br />
+I'd really like to be able to attach all my taxes forms to the day I have to pay them ;-) and more in general all the extra documentation regarding an appointment.<br /><br />Ciao,<br />&nbsp; Roberto<br /><br /> 
+  </blockquote> 
+  <p>Some unquoted line with single ' quotes.</p>
+  <p class="imp-signature"><!--begin_signature-->Jan.<br /> <br />
+-- <br />
+Do you need professional PHP or Horde consulting?<br /> <a target="_blank" href="http://horde.org/consulting/">http://horde.org/consulting/</a><!--end_signature--></p>
+EOT;
+
+        $text = <<<EOT
+Zitat von Roberto Maurizzi <roberto.maurizzi@gmail.com>:
+
+> > > > 4) In Turba, I can select a VFS driver to use. Currently it is
+> > > > set to
+> > > >   None and turba seems to be working fine. What does Turba use
+> > > > the VFS
+> > > >  for?
+> >  You can attach files to contacts with that.
+> >
+> >  Jan.
+> Anything similar for Kronolith, maybe in the new version?
+> I've googled a little and only found a discussion in 2004 about
+> having attachment (or links) from VFS in Kronolith.
+>  I'd really like to be able to attach all my taxes forms to the day
+> I have to pay them ;-) and more in general all the extra
+> documentation regarding an appointment.
+>
+> Ciao,
+>   Roberto
+
+Some unquoted line with single ' quotes.
+
+Jan.
+
+ --
+ Do you need professional PHP or Horde consulting?
+http://horde.org/consulting/
+EOT;
+
+        $filter = Horde_Text_Filter::filter($html, 'Html2text', array(
+            'width' => 70
+        ));
+        $this->assertEquals($text, $filter);
+    }
+
+}
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/Space2htmlTest.php b/framework/Text_Filter/test/Horde/Text/Filter/Space2htmlTest.php
new file mode 100644 (file)
index 0000000..3feeeca
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Horde_Text_Filter_Space2html tests.
+ *
+ * @author     Michael Slusarz <slusarz@horde.org>
+ * @category   Horde
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package    Text_Filter
+ * @subpackage UnitTests
+ */
+
+class Horde_Text_Filter_Space2htmlTest extends PHPUnit_Framework_TestCase
+{
+    public function testSpace2html()
+    {
+        $spaces = array(
+            'x x',
+            'x  x',
+            'x   x',
+            'x x',
+            'x         x'
+        );
+
+        $results = array(
+            'x x',
+            'x&nbsp; x',
+            'x&nbsp; &nbsp;x',
+            'x&nbsp; &nbsp; &nbsp; &nbsp; x',
+            'x&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x',
+        );
+
+        $results_encode_all = array(
+            'x&nbsp;x',
+            'x&nbsp;&nbsp;x',
+            'x&nbsp;&nbsp;&nbsp;x',
+            'x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x',
+            'x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x'
+        );
+
+        foreach ($spaces as $key => $val) {
+            $filter = Horde_Text_Filter::filter($val, 'space2html', array(
+                'encode_all' => false
+            ));
+            $this->assertEquals($results[$key], $filter);
+
+            $filter = Horde_Text_Filter::filter($val, 'space2html', array(
+                'encode_all' => true
+            ));
+            $this->assertEquals($results_encode_all[$key], $filter);
+        }
+    }
+
+}
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/Text2htmlTest.php b/framework/Text_Filter/test/Horde/Text/Filter/Text2htmlTest.php
new file mode 100644 (file)
index 0000000..a5785db
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Horde_Text_Filter_Text2html tests.
+ *
+ * @author     Michael Slusarz <slusarz@horde.org>
+ * @category   Horde
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package    Text_Filter
+ * @subpackage UnitTests
+ */
+
+class Horde_Text_Filter_Text2htmlTest extends PHPUnit_Framework_TestCase
+{
+    public function testText2html()
+    {
+        $tests = array(
+            'http://www.horde.org/foo/',
+            'https://jan:secret@www.horde.org/foo/',
+            'mailto:jan@example.com',
+            'svn+ssh://jan@svn.example.com/path/',
+            '<tag>foo</tag>',
+            '<http://css.maxdesign.com.au/listamatic/>',
+            'http://www.horde.org/?foo=bar&baz=qux',
+            'http://www.<alert>.horde.org/',
+            'http://www.&#x32;.horde.org/'
+        );
+
+        $levels = array(
+            Horde_Text_Filter_Text2html::PASSTHRU => array(
+                'http://www.horde.org/foo/',
+                'https://jan:secret@www.horde.org/foo/',
+                'mailto:jan@example.com',
+                'svn+ssh://jan@svn.example.com/path/',
+                '<tag>foo</tag>',
+                '<http://css.maxdesign.com.au/listamatic/>',
+                'http://www.horde.org/?foo=bar&baz=qux',
+                'http://www.<alert>.horde.org/',
+                'http://www.&#x32;.horde.org/',
+            ),
+            Horde_Text_Filter_Text2html::SYNTAX => array(
+                '<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a>',
+                '<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a>',
+                'mailto:<a href="mailto:jan@example.com">jan@example.com</a>',
+                '<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a>',
+                '&lt;tag&gt;foo&lt;/tag&gt;',
+                '&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;',
+                '<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a>',
+                '<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/',
+                '<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a>'
+            ),
+            Horde_Text_Filter_Text2html::MICRO => array(
+                '<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a>',
+                '<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a>',
+                'mailto:<a href="mailto:jan@example.com">jan@example.com</a>',
+                '<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a>',
+                '&lt;tag&gt;foo&lt;/tag&gt;',
+                '&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;',
+                '<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a>',
+                '<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/',
+                '<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a>'
+            ),
+            Horde_Text_Filter_Text2html::MICRO_LINKURL => array(
+                '<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a>',
+                '<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a>',
+                'mailto:jan@example.com',
+                '<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a>',
+                '&lt;tag&gt;foo&lt;/tag&gt;',
+                '&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;',
+                '<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a>',
+                '<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/',
+                '<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a>'
+            ),
+            Horde_Text_Filter_Text2html::NOHTML => array(
+                'http://www.horde.org/foo/',
+                'https://jan:secret@www.horde.org/foo/',
+                'mailto:jan@example.com',
+                'svn+ssh://jan@svn.example.com/path/',
+                '&lt;tag&gt;foo&lt;/tag&gt;',
+                '&lt;http://css.maxdesign.com.au/listamatic/&gt;',
+                'http://www.horde.org/?foo=bar&amp;baz=qux',
+                'http://www.&lt;alert&gt;.horde.org/',
+                'http://www.&amp;#x32;.horde.org/'
+            ),
+            Horde_Text_Filter_Text2html::NOHTML_NOBREAK => array(
+                'http://www.horde.org/foo/',
+                'https://jan:secret@www.horde.org/foo/',
+                'mailto:jan@example.com',
+                'svn+ssh://jan@svn.example.com/path/',
+                '&lt;tag&gt;foo&lt;/tag&gt;',
+                '&lt;http://css.maxdesign.com.au/listamatic/&gt;',
+                'http://www.horde.org/?foo=bar&amp;baz=qux',
+                'http://www.&lt;alert&gt;.horde.org/',
+                'http://www.&amp;#x32;.horde.org/'
+            )
+        );
+
+        foreach ($levels as $level => $results) {
+            foreach ($tests as $key => $val) {
+                $filter = Horde_Text_Filter::filter($val, 'text2html', array(
+                    'parselevel' => $level
+                ));
+                $this->assertEquals($results[$key], $filter);
+            }
+        }
+    }
+
+}
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/emails.phpt b/framework/Text_Filter/test/Horde/Text/Filter/emails.phpt
deleted file mode 100644 (file)
index 9f39920..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
---TEST--
-Horde_Text_Filter_Email tests
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Emails.php';
-
-$emails = <<<EOT
-Inline address test@example.com test.
-Inline protocol mailto: test@example.com test with whitespace.
-Inline Outlook [mailto:test@example.com] test.
-Inline angle brackets <test@example.com> test.
-Inline angle brackets (HTML) &lt;test@example.com&gt; test.
-Inline angle brackets with mailto &lt;mailto:test@example.com&gt; test.
-Inline with parameters test@example.com?subject=A%20subject&body=The%20message%20body test.
-Inline protocol with parameters mailto:test@example.com?subject=A%20subject&body=The%20message%20body test.
-test@example.com in front test.
-At end test of test@example.com
-Don't link http://test@www.horde.org/ test.
-Real world example: mailto:pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&body=%5b%23ptn6Pw-1%5d
-EOT;
-
-echo Horde_Text_Filter::filter($emails, 'emails', array('class' => 'pagelink'));
-
-?>
---EXPECT--
-Inline address <a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a> test.
-Inline protocol mailto: <a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a> test with whitespace.
-Inline Outlook [mailto:<a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a>] test.
-Inline angle brackets &lt;<a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a>&gt; test.
-Inline angle brackets (HTML) &lt;<a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a>&gt; test.
-Inline angle brackets with mailto &lt;mailto:<a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a>&gt; test.
-Inline with parameters <a class="pagelink" href="mailto:test@example.com?subject=A%20subject&body=The%20message%20body" title="New Message to test@example.com">test@example.com?subject=A%20subject&body=The%20message%20body</a> test.
-Inline protocol with parameters mailto:<a class="pagelink" href="mailto:test@example.com?subject=A%20subject&body=The%20message%20body" title="New Message to test@example.com">test@example.com?subject=A%20subject&body=The%20message%20body</a> test.
-<a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a> in front test.
-At end test of <a class="pagelink" href="mailto:test@example.com" title="New Message to test@example.com">test@example.com</a>
-Don't link http://test@www.horde.org/ test.
-Real world example: mailto:<a class="pagelink" href="mailto:pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&body=%5b%23ptn6Pw-1%5d" title="New Message to pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com">pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&body=%5b%23ptn6Pw-1%5d</a>
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/environment.phpt b/framework/Text_Filter/test/Horde/Text/Filter/environment.phpt
deleted file mode 100644 (file)
index 05a6bc0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-Horde_Text_Filter_Environment tests
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Environment.php';
-
-$env = <<<EOT
-Simple line
-Inline %FOO% variable
-%FOO% at start
-at end %FOO%
-# %COMMENT% line
-Variable %FOO% with # comment %COMMENT%
-Simple line
-EOT;
-
-putenv('FOO=bar');
-putenv('COMMENT=comment');
-echo Horde_Text_Filter::filter($env, 'environment');
-
-?>
---EXPECT--
-Simple line
-Inline bar variable
-bar at start
-at end bar
-Variable bar with 
-Simple line
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/fixtures/html2text.html b/framework/Text_Filter/test/Horde/Text/Filter/fixtures/html2text.html
deleted file mode 100644 (file)
index 7aecb38..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-<h2>Inline Formatting</h2>
-
-    Some text with leading and trailing whitespace  
-
-<br />
-
-<hr />
-
-<h2>Table</h2>
-
-<table class="table">
-    <tr>
-        <th>Type</th>
-        <th>Representation</th>
-    </tr>
-    <tr>
-        <td class="table-cell">emphasis text</td>
-        <td class="table-cell"><em>emphasis text</em></td>
-    </tr>
-    <tr>
-        <td class="table-cell">strong text</td>
-        <td class="table-cell"><strong>strong text</strong></td>
-    </tr>
-    <tr>
-        <td class="table-cell">italic text</td>
-        <td class="table-cell"><i>italic text</i></td>
-    </tr>
-    <tr>
-        <td class="table-cell">bold text</td>
-        <td class="table-cell"><b>bold text</b></td>
-    </tr>
-    <tr>
-        <td class="table-cell">emphasis and strong</td>
-        <td class="table-cell"><em><strong>emphasis and strong</strong></em></td>
-    </tr>
-    <tr>
-        <td class="table-cell">underline text</td>
-        <td class="table-cell"><u>underline text</u></td>
-    </tr>
-</table>
-
-<hr />
-
-
-<h2>Links</h2>
-<a href="http://www.horde.org">Horde Homepage</a><br />
-<a href="mailto:test@example.com">Test User</a><br />
-Some inline <a href="http://www.horde.org">link</a>.<br />
-<a href="http://www.example.com">http://www.example.com</a><br />
-
-<hr />
-
-
-<h2>Headings</h2>
-<p>You can make various levels of heading by putting equals-signs before and
-after the text (all on its own line):</p>
-
-<h3>level 3 heading</h3>
-<h4>level 4 heading</h4>
-
-<h5>level 5 heading</h5>
-<h6>level 6 heading</h6>
-
-<hr />
-
-
-<h3>Bullet Lists</h3>
-<p>You can create bullet lists by starting a paragraph with one or more
-asterisks.</p>
-
-<ul>
-    <li>Bullet one<ul>
-        <li>Sub-bullet</li>
-    </ul></li>
-</ul>
-
-<h3>Numbered Lists</h3>
-<p>Similarly, you can create numbered lists by starting a paragraph with one
-or more hashes.</p>
-
-<ol>
-    <li>Numero uno</li>
-    <li>Number two<ol>
-        <li>Sub-item</li>
-    </ol></li>
-
-</ol>
-
-<h3>Mixing Bullet and Number List Items</h3>
-<p>You can mix and match bullet and number lists:</p>
-
-<ol>
-    <li>Number one<ul>
-        <li>Bullet</li>
-        <li>Bullet</li>
-    </ul></li>
-    <li>Number two<ul>
-        <li>Bullet</li>
-        <li>Bullet<ul>
-            <li>Sub-bullet<ol>
-                <li>Sub-sub-number</li>
-                <li>Sub-sub-number</li>
-            </ol></li>
-        </ul></li>
-    </ul></li>
-    <li>Number three<ul>
-        <li>Bullet</li>
-        <li>Bullet</li>
-    </ul></li>
-</ol>
-
-
-<h2>Block quoting</h2>
-<blockquote type="cite">
-<a href="http://www.horde.org">Horde Homepage</a><br />
-Some inline <a href="http://www.horde.org">link</a>.<br />
-</blockquote>
-
-Line inbetween.
-
-<blockquote type="cite">
-<h2>Heading inside quoting</h2>
-<p>This is a paragraph inside a block quoting. The result should be several
-lines prefixed with the &gt; character.</p>
-</blockquote>
-
-
-<h2>Special Characters</h2>
-
-<div>
-&auml;
-&eacute;
-&copy;
-&trade;
-&#x0110;
-</div>
-
-<p>Zitat von John Doe &lt;john.doe@example.com&gt;:</p>
-  <blockquote type="cite"> 
-    <div class="Section1"> 
-      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Hallo lieber John,<o:p /></span></font></p> 
-      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p> 
-      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Blah, blah.'<o:p /></span></font></p> 
-      <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p> 
-      <p class="MsoNormal"><font size="3" face="Times New Roman"><span lang="EN-GB" style="font-size: 12pt;"><o:p> </o:p></span></font></p> 
-    </div> 
-  </blockquote> 
-  <p> </p>
-  <p class="imp-signature"><!--begin_signature-->-- <br />
-Some signature<br /><a target="_blank" href="http://www.example.com">http://www.example.com</a><!--end_signature--></p>
-
-<p>Zitat von Jane Doe &lt;jane.doe@example.com&gt;:</p>
-  <blockquote type="cite">
-Jan Schneider a écrit&nbsp;:
-
-    <blockquote type="cite" cite="mid:20081007135151.190315kzjzymtbhc@neo.wg.de">Zitat von Jane Doe
-<a href="mailto:jane.doe@example.com" class="moz-txt-link-rfc2396E">&lt;jane.doe@example.com&gt;</a>:
-  <br /> <br /> 
-      <blockquote type="cite">Hi,
-    <br /> <br />
-I prepare the last &quot;horde-webmail-1.2&quot; for production level but I have
-few questions:
-    <br />
-- is there a way to disable &quot;external_display_cal&quot; in kronolith, I
-don't want seeing birthdays calendars (turba) and task list (nag)
-    <br /> </blockquote> <br />
-They aren't displayed by default, or do you mean you don't want them to
-appear in the top right calendar panel?
-  <br /> 
-    </blockquote>
-Yes I don't want them to appear in the top right calendar panel but I
-want user can create their external_cal<br />
-  </blockquote><br />
-  <p class="imp-signature"><!--begin_signature-->Jan.<br /> <br />
--- <br />
-Do you need professional PHP or Horde consulting?<br /> <a target="_blank" href="http://horde.org/consulting/">http://horde.org/consulting/</a><!--end_signature--></p>
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/fixtures/text2html.txt b/framework/Text_Filter/test/Horde/Text/Filter/fixtures/text2html.txt
deleted file mode 100644 (file)
index 550e1e7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-http://www.horde.org/foo/
-https://jan:secret@www.horde.org/foo/
-mailto:jan@example.com
-svn+ssh://jan@svn.example.com/path/
-<tag>foo</tag>
-<http://css.maxdesign.com.au/listamatic/>
-http://www.horde.org/?foo=bar&baz=qux
-http://www.<alert>.horde.org/
-http://www.&#x32;.horde.org/
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/html2text.phpt b/framework/Text_Filter/test/Horde/Text/Filter/html2text.phpt
deleted file mode 100644 (file)
index 30d5964..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
---TEST--
-Horde_Text_Filter_Html2text tests
---FILE--
-<?php
-
-require_once 'Horde/String.php';
-require_once 'Horde/Util.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Html2text.php';
-$html = file_get_contents(dirname(__FILE__) . '/fixtures/html2text.html');
-echo Horde_Text_Filter::filter($html, 'Html2text', array('charset' => 'UTF-8'));
-
-?>
---EXPECT--
-INLINE FORMATTING
-
-Some text with leading and trailing whitespace
-
--------------------------
-
-TABLE
-
-  TYPE         REPRESENTATION
-  emphasis text        /emphasis text/
-  strong text  STRONG TEXT
-  italic text  /italic text/
-  bold text    BOLD TEXT
-  emphasis and strong  /EMPHASIS AND STRONG/
-  underline text       _underline text_
-
--------------------------
-
-LINKS
-
-Horde Homepage[1]
-Test User[2]
-Some inline link[1].
-http://www.example.com
-
--------------------------
-
-HEADINGS
-
-You can make various levels of heading by putting equals-signs before
-and after the text (all on its own line):
-
-LEVEL 3 HEADING
-
-Level 4 Heading
-
-Level 5 Heading
-
-Level 6 Heading
-
--------------------------
-
-BULLET LISTS
-
-You can create bullet lists by starting a paragraph with one or more
-asterisks.
-
-  * Bullet one
-
-    * Sub-bullet
-
-NUMBERED LISTS
-
-Similarly, you can create numbered lists by starting a paragraph with
-one or more hashes.
-
-  * Numero uno
-  * Number two
-
-    * Sub-item
-
-MIXING BULLET AND NUMBER LIST ITEMS
-
-You can mix and match bullet and number lists:
-
-  * Number one
-
-    * Bullet
-    * Bullet
-
-  * Number two
-
-    * Bullet
-    * Bullet
-
-      * Sub-bullet
-
-        * Sub-sub-number
-        * Sub-sub-number
-
-  * Number three
-
-    * Bullet
-    * Bullet
-
-BLOCK QUOTING
-
-> Horde Homepage[1]
->  Some inline link[1].
-
-Line inbetween.
-
-> HEADING INSIDE QUOTING
->
->
-> This is a paragraph inside a block quoting. The result should be
-> several lines prefixed with the > character.
-
-SPECIAL CHARACTERS
-
-ä é © ™ Đ
-
-Zitat von John Doe <john.doe@example.com>:
-
-> Hallo lieber John,
->
-> Blah, blah.'
-
---
- Some signature
-http://www.example.com
-
-Zitat von Jane Doe <jane.doe@example.com>:
-
-> Jan Schneider a écrit :
-> > Zitat von Jane Doe <jane.doe@example.com>[3]:
-> > > Hi,
-> > >
-> > >  I prepare the last "horde-webmail-1.2" for production level but
-> > > I have few questions:
-> > >  - is there a way to disable "external_display_cal" in
-> > > kronolith, I don't want seeing birthdays calendars (turba) and
-> > > task list (nag)
-> >  They aren't displayed by default, or do you mean you don't want
-> > them to appear in the top right calendar panel?
->  Yes I don't want them to appear in the top right calendar panel but
-> I want user can create their external_cal
-
-Jan.
-
- --
- Do you need professional PHP or Horde consulting?
-http://horde.org/consulting/
-
-
-Links:
-------
-[1] http://www.horde.org
-[2] mailto:test@example.com
-[3] mailto:jane.doe@example.com
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/html2text2.phpt b/framework/Text_Filter/test/Horde/Text/Filter/html2text2.phpt
deleted file mode 100644 (file)
index d766b75..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Horde_Text_Filter_Html2text lists test
---FILE--
-<?php
-
-require_once 'Horde/String.php';
-require_once 'Horde/Util.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Html2text.php';
-
-$html = <<<EOT
-<ul>
-  <li>This is a short line.</li>
-  <li>This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line.</li>
-  <li>And again a short line.</li>
-</ul>
-EOT;
-
-echo Horde_Text_Filter::filter($html, 'Html2text', array('wrap' => 50));
-echo "\n\n";
-echo Horde_Text_Filter::filter($html, 'Html2text', array('wrap' => false));
-
-?>
---EXPECT--
-  * This is a short line.
-  * This is a long line. This is a long line. This
-is a long line. This is a long line. This is a
-long line. This is a long line. This is a long
-line. This is a long line. This is a long line.
-This is a long line. This is a long line. This is
-a long line.
-  * And again a short line.
-
-  * This is a short line.
-  * This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line. This is a long line.
-  * And again a short line.
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/html2text3.phpt b/framework/Text_Filter/test/Horde/Text/Filter/html2text3.phpt
deleted file mode 100644 (file)
index 713ee97..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
---TEST--
-Horde_Text_Filter_Html2text quoting test
---FILE--
-<?php
-
-require_once 'Horde/String.php';
-require_once 'Horde/Util.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Html2text.php';
-$html = <<<EOT
-<p>Zitat von Roberto Maurizzi &lt;roberto.maurizzi@gmail.com&gt;:</p>
-  <blockquote type="cite">
-    <div class="gmail_quote">
-      <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
-        <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"> 
-          <div class="Ih2E3d">
-            <blockquote style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">4) In Turba, I can select a VFS driver to use. Currently it is set to<br />
-
-None and turba seems to be working fine. What does Turba use the VFS<br />
-for?<br /> </blockquote> 
-          </div>
-        </blockquote><br />
-You can attach files to contacts with that.<br /> <br />
-Jan.<br /><font color="#888888"> </font>
-      </blockquote>
-      <div><br /></div>
-    </div>Anything similar for Kronolith, maybe in the new version?<br />I've googled a little and only found a discussion in 2004 about having attachment (or links) from VFS in Kronolith.<br />
-I'd really like to be able to attach all my taxes forms to the day I have to pay them ;-) and more in general all the extra documentation regarding an appointment.<br /><br />Ciao,<br />&nbsp; Roberto<br /><br /> 
-  </blockquote> 
-  <p>Some unquoted line with single ' quotes.</p>
-  <p class="imp-signature"><!--begin_signature-->Jan.<br /> <br />
--- <br />
-Do you need professional PHP or Horde consulting?<br /> <a target="_blank" href="http://horde.org/consulting/">http://horde.org/consulting/</a><!--end_signature--></p>
-EOT;
-echo Horde_Text_Filter::filter($html, 'html2text');
-
-?>
---EXPECT--
-Zitat von Roberto Maurizzi <roberto.maurizzi@gmail.com>:
-
-> > > > 4) In Turba, I can select a VFS driver to use. Currently it is
-> > > > set to
-> > > >   None and turba seems to be working fine. What does Turba use
-> > > > the VFS
-> > > >  for?
-> >  You can attach files to contacts with that.
-> >
-> >  Jan.
-> Anything similar for Kronolith, maybe in the new version?
-> I've googled a little and only found a discussion in 2004 about
-> having attachment (or links) from VFS in Kronolith.
->  I'd really like to be able to attach all my taxes forms to the day
-> I have to pay them ;-) and more in general all the extra
-> documentation regarding an appointment.
->
-> Ciao,
->   Roberto
-
-Some unquoted line with single ' quotes.
-
-Jan.
-
- --
- Do you need professional PHP or Horde consulting?
-http://horde.org/consulting/
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/space2html.phpt b/framework/Text_Filter/test/Horde/Text/Filter/space2html.phpt
deleted file mode 100644 (file)
index 614e94f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-Horde_Text_Filter_Space2html tests
---FILE--
-<?php
-
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Space2html.php';
-
-$spaces = array('x x', 'x  x', 'x   x', 'x     x', 'x          x');
-foreach ($spaces as $space) {
-    echo Horde_Text_Filter::filter($space, 'space2html', array('encode_all' => false));
-    echo "\n";
-    echo Horde_Text_Filter::filter($space, 'space2html', array('encode_all' => true));
-    echo "\n";
-}
-
-?>
---EXPECT--
-x x
-x&nbsp;x
-x&nbsp; x
-x&nbsp;&nbsp;x
-x&nbsp; &nbsp;x
-x&nbsp;&nbsp;&nbsp;x
-x&nbsp; &nbsp; &nbsp; &nbsp; x
-x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x
-x&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x
-x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x
diff --git a/framework/Text_Filter/test/Horde/Text/Filter/text2html.phpt b/framework/Text_Filter/test/Horde/Text/Filter/text2html.phpt
deleted file mode 100644 (file)
index d462aa0..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
---TEST--
-Horde_Text_Filter_Text2html tests
---FILE--
-<?php
-
-require_once 'Horde.php';
-require_once 'Horde/Exception.php';
-require_once 'Horde/String.php';
-require_once 'Horde/Util.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Base.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Emails.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Linkurls.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Space2html.php';
-require dirname(__FILE__) . '/../../../../lib/Horde/Text/Filter/Text2html.php';
-
-$_COOKIE[session_name()] = true;
-$text = file_get_contents(dirname(__FILE__) . '/fixtures/text2html.txt');
-$params = array('class' => null);
-$levels = array(Horde_Text_Filter_Text2html::PASSTHRU,
-                Horde_Text_Filter_Text2html::SYNTAX,
-                Horde_Text_Filter_Text2html::MICRO,
-                Horde_Text_Filter_Text2html::MICRO_LINKURL,
-                Horde_Text_Filter_Text2html::NOHTML,
-                Horde_Text_Filter_Text2html::NOHTML_NOBREAK);
-
-foreach ($levels as $level) {
-    $params['parselevel'] = $level;
-    echo Horde_Text_Filter::filter($text, 'text2html', $params);
-    echo "-------------------------------------------------\n";
-}
-
-?>
---EXPECT--
-http://www.horde.org/foo/
-https://jan:secret@www.horde.org/foo/
-mailto:jan@example.com
-svn+ssh://jan@svn.example.com/path/
-<tag>foo</tag>
-<http://css.maxdesign.com.au/listamatic/>
-http://www.horde.org/?foo=bar&baz=qux
-http://www.<alert>.horde.org/
-http://www.&#x32;.horde.org/
--------------------------------------------------
-<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a><br />
-<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a><br />
-mailto:<a href="mailto:jan@example.com" title="New Message to jan@example.com">jan@example.com</a><br />
-<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a><br />
-&lt;tag&gt;foo&lt;/tag&gt;<br />
-&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;<br />
-<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a><br />
-<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/<br />
-<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a><br />
--------------------------------------------------
-<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a><br />
-<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a><br />
-mailto:<a href="mailto:jan@example.com" title="New Message to jan@example.com">jan@example.com</a><br />
-<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a><br />
-&lt;tag&gt;foo&lt;/tag&gt;<br />
-&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;<br />
-<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a><br />
-<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/<br />
-<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a><br />
--------------------------------------------------
-<a href="http://www.horde.org/foo/" target="_blank">http://www.horde.org/foo/</a><br />
-<a href="https://jan:secret@www.horde.org/foo/" target="_blank">https://jan:secret@www.horde.org/foo/</a><br />
-mailto:jan@example.com<br />
-<a href="svn+ssh://jan@svn.example.com/path/" target="_blank">svn+ssh://jan@svn.example.com/path/</a><br />
-&lt;tag&gt;foo&lt;/tag&gt;<br />
-&lt;<a href="http://css.maxdesign.com.au/listamatic/" target="_blank">http://css.maxdesign.com.au/listamatic/</a>&gt;<br />
-<a href="http://www.horde.org/?foo=bar&amp;baz=qux" target="_blank">http://www.horde.org/?foo=bar&amp;baz=qux</a><br />
-<a href="http://www" target="_blank">http://www</a>.&lt;alert&gt;.horde.org/<br />
-<a href="http://www.&amp;#x32;.horde.org/" target="_blank">http://www.&amp;#x32;.horde.org/</a><br />
--------------------------------------------------
-http://www.horde.org/foo/<br />
-https://jan:secret@www.horde.org/foo/<br />
-mailto:jan@example.com<br />
-svn+ssh://jan@svn.example.com/path/<br />
-&lt;tag&gt;foo&lt;/tag&gt;<br />
-&lt;http://css.maxdesign.com.au/listamatic/&gt;<br />
-http://www.horde.org/?foo=bar&amp;baz=qux<br />
-http://www.&lt;alert&gt;.horde.org/<br />
-http://www.&amp;#x32;.horde.org/<br />
--------------------------------------------------
-http://www.horde.org/foo/
-https://jan:secret@www.horde.org/foo/
-mailto:jan@example.com
-svn+ssh://jan@svn.example.com/path/
-&lt;tag&gt;foo&lt;/tag&gt;
-&lt;http://css.maxdesign.com.au/listamatic/&gt;
-http://www.horde.org/?foo=bar&amp;baz=qux
-http://www.&lt;alert&gt;.horde.org/
-http://www.&amp;#x32;.horde.org/
--------------------------------------------------