From 3412e50b54e3daac8745234e21ab6e72be0ed165 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 04 Jun 2014 11:20:33 -0400
Subject: [PATCH] Fix attachment menu structure and aria-attributes

---
 tests/Framework/StringReplacer.php |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php
index 8f6eaf4..0fa7fae 100644
--- a/tests/Framework/StringReplacer.php
+++ b/tests/Framework/StringReplacer.php
@@ -41,6 +41,7 @@
             array('http://', 'http://'),
             array('1@1.com www.domain.tld', '<a href="mailto:1@1.com">1@1.com</a> <a href="http://www.domain.tld">www.domain.tld</a>'),
             array(' www.domain.tld ', ' <a href="http://www.domain.tld">www.domain.tld</a> '),
+            array(' www.domain.tld/#!download|856p1|2 ', ' <a href="http://www.domain.tld/#!download|856p1|2">www.domain.tld/#!download|856p1|2</a> '),
         );
     }
 
@@ -55,4 +56,20 @@
 
         $this->assertEquals($output, $result);
     }
+
+    function test_linkrefs()
+    {
+        $input = "This is a sample message [1] to test the new linkref [ref0] replacement feature of [Roundcube].\n";
+        $input.= "\n";
+        $input.= "[1] http://en.wikipedia.org/wiki/Email\n";
+        $input.= "[ref0] www.link-ref.com\n";
+
+        $replacer = new rcube_string_replacer;
+        $result = $replacer->replace($input);
+        $result = $replacer->resolve($result);
+
+        $this->assertContains('[<a href="http://en.wikipedia.org/wiki/Email">1</a>] to', $result, "Numeric linkref replacements");
+        $this->assertContains('[<a href="http://www.link-ref.com">ref0</a>] repl', $result, "Alphanum linkref replacements");
+        $this->assertContains('of [Roundcube].', $result, "Don't touch strings wihtout an index entry");
+    }
 }

--
Gitblit v1.9.1