summaryrefslogtreecommitdiff
path: root/tests/TagURITest.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-02-24 20:52:45 -0500
committerCraig Andrews <candrews@integralblue.com>2010-02-24 20:52:45 -0500
commitc187bf55974347f7ddb4f28714af57861dce8f08 (patch)
tree4398b456d88ce79977959b25ba1a0f6fe0c1d77f /tests/TagURITest.php
parent20d6a7caed6636c28cc7b95c584549691dff4388 (diff)
parent8914b69d5055c1bc7d0604ee338ffdaf6b0a8606 (diff)
Merge branch '0.9.x' into 1.0.x
Conflicts: EVENTS.txt db/statusnet.sql lib/queuemanager.php
Diffstat (limited to 'tests/TagURITest.php')
-rw-r--r--tests/TagURITest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/TagURITest.php b/tests/TagURITest.php
new file mode 100644
index 000000000..d23f8bfe6
--- /dev/null
+++ b/tests/TagURITest.php
@@ -0,0 +1,36 @@
+<?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('STATUSNET', true);
+
+require_once INSTALLDIR . '/lib/common.php';
+
+$config['site']['server'] = 'example.net';
+$config['site']['path'] = '/apps/statusnet';
+
+class TagURITest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider provider
+ */
+ public function testProduction($format, $args, $uri)
+ {
+ $minted = call_user_func_array(array('TagURI', 'mint'),
+ array_merge(array($format), $args));
+
+ $this->assertEquals($uri, $minted);
+ }
+
+ static public function provider()
+ {
+ return array(array('favorite:%d:%d',
+ array(1, 3),
+ 'tag:example.net,'.date('Y-m-d').':apps:statusnet:favorite:1:3'));
+ }
+}
+