summaryrefslogtreecommitdiff
path: root/tests/TagURITest.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-05 03:56:04 +0000
committerZach Copley <zach@status.net>2010-03-05 03:56:04 +0000
commitb8001ea1079c4c8895fd2323e1e4a47c0d71fde3 (patch)
treeb732b239bf790c78c90f4c7d3be7044ce9f7da45 /tests/TagURITest.php
parente3c4b0c85d3fbae9604b22d3666fe36a3c1c7551 (diff)
parent064c45890f896f2af8a0231449fa5337bb79c509 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
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'));
+ }
+}
+