]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/TagURITest.php
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / tests / TagURITest.php
1 <?php
2
3 if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
4     print "This script must be run from the command line\n";
5     exit();
6 }
7
8 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
9 define('STATUSNET', true);
10
11 require_once INSTALLDIR . '/lib/common.php';
12
13 $config['site']['server'] = 'example.net';
14 $config['site']['path']   = '/apps/statusnet';
15
16 class TagURITest extends PHPUnit_Framework_TestCase
17 {
18     /**
19      * @dataProvider provider
20      */
21     public function testProduction($format, $args, $uri)
22     {
23         $minted = call_user_func_array(array('TagURI', 'mint'),
24                                        array_merge(array($format), $args));
25
26         $this->assertEquals($uri, $minted);
27     }
28
29     static public function provider()
30     {
31         return array(array('favorite:%d:%d',
32                            array(1, 3),
33                            'tag:example.net,'.date('Y-m-d').':apps:statusnet:favorite:1:3'));
34     }
35 }
36