diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-21 11:12:56 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-21 11:12:56 -0800 |
commit | 85528ccb1f5840a8c73f6c939f12d98bb3680cde (patch) | |
tree | be0f09c02a2bf003c23d6be98919783347b9786d /tests | |
parent | 86f2f530ef60fdb601720885d493cf5b2a446e6b (diff) | |
parent | 3e7a2a4014dd93637f5a666e238dde13e397523c (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TagURITest.php | 36 |
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')); + } +} + |