gnu-social/tests/TagURITest.php
Mikael Nordfeldth 633191d808 Making sure scripts and tests check for GNUSOCIAL defined (instead of STATUSNET)
Orbited plugin may not work at all anymore, I had no means to try it.
But there's a check whether 'LACONICA' is defined there, which is a
very unlikely thing in the future. So far only tests and scripts have
been migrated consistently, though.
2013-09-28 15:20:10 +02:00

38 lines
1010 B
PHP

<?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('GNUSOCIAL', true);
define('STATUSNET', true); // compatibility
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'));
}
}