]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
beginning of hashtag tests
authorBrenda Wallace <shiny@cpan.org>
Mon, 24 Aug 2009 22:33:16 +0000 (10:33 +1200)
committerBrenda Wallace <shiny@cpan.org>
Tue, 25 Aug 2009 06:44:32 +0000 (18:44 +1200)
tests/HashTagDetectionTest.php [new file with mode: 0644]

diff --git a/tests/HashTagDetectionTest.php b/tests/HashTagDetectionTest.php
new file mode 100644 (file)
index 0000000..71137b0
--- /dev/null
@@ -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>'),
+                     );
+    }
+}
+