summaryrefslogtreecommitdiff
path: root/tests/HashTagDetectionTests.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2009-08-26 10:00:29 +1200
committerBrenda Wallace <shiny@cpan.org>2009-08-26 10:00:29 +1200
commit3400f6f431436552d3bef81a4b25733db2cdd9b6 (patch)
tree95ac47e42833bd43a28fc7ac15462226f3bc7abc /tests/HashTagDetectionTests.php
parent31329c33aee7f3d4b5c1dd80f32fcd45e7877850 (diff)
renamed to plural, for consitency
Diffstat (limited to 'tests/HashTagDetectionTests.php')
-rw-r--r--tests/HashTagDetectionTests.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/HashTagDetectionTests.php b/tests/HashTagDetectionTests.php
new file mode 100644
index 000000000..4f0b31b0d
--- /dev/null
+++ b/tests/HashTagDetectionTests.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 HashTagDetectionTests 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',
+ '#<span class="tag"><a href="' . common_local_url('tag', array('tag' => common_canonical_tag('hello'))) . '" rel="tag">hello</a></span>'),
+ );
+ }
+}
+