summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2009-08-25 10:33:16 +1200
committerBrenda Wallace <shiny@cpan.org>2009-08-25 18:44:32 +1200
commit3ff67b3bc185be255d0b54f7f9af7c9578b4330b (patch)
tree5828862d5fe3dbfd17556805e5cb12a11755d00d /tests
parenteceffc4c01acd8e07cdb3b0a8591a7e65e5317be (diff)
beginning of hashtag tests
Diffstat (limited to 'tests')
-rw-r--r--tests/HashTagDetectionTest.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/HashTagDetectionTest.php b/tests/HashTagDetectionTest.php
new file mode 100644
index 000000000..71137b0b5
--- /dev/null
+++ b/tests/HashTagDetectionTest.php
@@ -0,0 +1,35 @@
+<?php
+
+if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
+ print "This script must be run from the command line\n";
+ exit();
+}
+
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('LACONICA', true);
+
+require_once INSTALLDIR . '/lib/common.php';
+
+class HashTagDetectionTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ *
+ */
+ public function testProduction($content, $expected)
+ {
+ $rendered = common_render_text($content);
+ $this->assertEquals($expected, $rendered);
+ }
+
+ static public function provider()
+ {
+ return array(
+ array('hello',
+ 'hello'),
+ array('#hello',
+ '<a href="/tag/hello">hello</a>'),
+ );
+ }
+}
+