summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-21 11:12:56 -0800
committerBrion Vibber <brion@pobox.com>2010-02-21 11:12:56 -0800
commit85528ccb1f5840a8c73f6c939f12d98bb3680cde (patch)
treebe0f09c02a2bf003c23d6be98919783347b9786d /tests
parent86f2f530ef60fdb601720885d493cf5b2a446e6b (diff)
parent3e7a2a4014dd93637f5a666e238dde13e397523c (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'tests')
-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'));
+ }
+}
+