Eric Lippmann da7f619804 Framework: Implement DateFormat view helper
Support date, time and datetime formatting based on format strings
set either by the user or via config.ini. The view helper
FormDateTime uses the new helper already

refs #4440
refs #4424
2013-08-12 16:43:09 +02:00

73 lines
2.1 KiB
PHP

<?php
namespace Tests\Icinga;
require_once __DIR__ . '/../../../../library/Icinga/User.php';
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences.php';
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences/ChangeSet.php';
use Icinga\User as IcingaUser;
use Icinga\User\Preferences as UserPreferences;
class UserTest extends \PHPUnit_Framework_TestCase
{
public function testListGroups()
{
$this->markTestIncomplete('testListGroups is not implemented yet');
}
public function testIsMemberOf()
{
$this->markTestIncomplete('testIsMemberOf is not implemented yet');
}
public function testGetPermissionList()
{
$this->markTestIncomplete('testGetPermissionList is not implemented yet');
}
public function testHasPermission()
{
$this->markTestIncomplete('testHasPermission is not implemented yet');
}
public function testGrantPermission()
{
$this->markTestIncomplete('testGrantPermission is not implemented yet');
}
public function testRevokePermission()
{
$this->markTestIncomplete('testRevokePermission is not implemented yet');
}
public function testGetDefaultTimezoneIfTimezoneNotSet()
{
$defaultTz = 'UTC';
date_default_timezone_set($defaultTz);
$user = new IcingaUser('unittest');
$prefs = new UserPreferences(array());
$user->setPreferences($prefs);
$this->assertEquals($user->getTimeZone(), $defaultTz,
'User\'s timezone does not match the default timezone'
);
}
public function testGetTimezoneIfTimezoneSet()
{
$defaultTz = 'UTC';
$explicitTz = 'Europe/Berlin';
date_default_timezone_set($defaultTz);
$user = new IcingaUser('unittest');
$prefs = new UserPreferences(array(
'timezone' => $explicitTz
));
$user->setPreferences($prefs);
$this->assertEquals($user->getTimeZone(), $explicitTz,
'User\'s timezone does not match the timezone set by himself'
);
}
}