summaryrefslogtreecommitdiff
path: root/tests/Framework/StringReplacer.php
diff options
context:
space:
mode:
authorHugues Hiegel <root@paranoid>2014-08-05 16:46:22 +0200
committerHugues Hiegel <root@paranoid>2014-08-05 16:46:22 +0200
commit59478e06c25303a790a0840ab2ac30662c4ef781 (patch)
tree8d5e964a8f94adaef41efebb0597629f11495c42 /tests/Framework/StringReplacer.php
parent7c494b677f9e470ee0d32e62cfa8dc709f39e748 (diff)
c'est la merde..working
Diffstat (limited to 'tests/Framework/StringReplacer.php')
-rw-r--r--tests/Framework/StringReplacer.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php
index e23fb9b17..0fa7fae34 100644
--- a/tests/Framework/StringReplacer.php
+++ b/tests/Framework/StringReplacer.php
@@ -56,4 +56,20 @@ class Framework_StringReplacer extends PHPUnit_Framework_TestCase
$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");
+ }
}