]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - tests/TagURITest.php
Merge commit 'refs/merge-requests/43' of https://gitorious.org/social/mainline into...
[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('GNUSOCIAL', true);
10 define('STATUSNET', true);  // compatibility
11
12 require_once INSTALLDIR . '/lib/common.php';
13
14 $config['site']['server'] = 'example.net';
15 $config['site']['path']   = '/apps/statusnet';
16
17 class TagURITest extends PHPUnit_Framework_TestCase
18 {
19     /**
20      * @dataProvider provider
21      */
22     public function testProduction($format, $args, $uri)
23     {
24         $minted = call_user_func_array(array('TagURI', 'mint'),
25                                        array_merge(array($format), $args));
26
27         $this->assertEquals($uri, $minted);
28     }
29
30     static public function provider()
31     {
32         return array(array('favorite:%d:%d',
33                            array(1, 3),
34                            'tag:example.net,'.date('Y-m-d').':apps:statusnet:favorite:1:3'));
35     }
36 }
37