mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
Tests: Fix UserTest as getTimeZone now returns a DateTimeZone object
refs #4440
This commit is contained in:
parent
ba00fd39df
commit
3d104474d9
@ -6,6 +6,7 @@ require_once __DIR__ . '/../../../../library/Icinga/User.php';
|
|||||||
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences.php';
|
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences.php';
|
||||||
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences/ChangeSet.php';
|
require_once __DIR__ . '/../../../../library/Icinga/User/Preferences/ChangeSet.php';
|
||||||
|
|
||||||
|
use \DateTimeZone;
|
||||||
use Icinga\User as IcingaUser;
|
use Icinga\User as IcingaUser;
|
||||||
use Icinga\User\Preferences as UserPreferences;
|
use Icinga\User\Preferences as UserPreferences;
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
|||||||
$user = new IcingaUser('unittest');
|
$user = new IcingaUser('unittest');
|
||||||
$prefs = new UserPreferences(array());
|
$prefs = new UserPreferences(array());
|
||||||
$user->setPreferences($prefs);
|
$user->setPreferences($prefs);
|
||||||
$this->assertEquals($user->getTimeZone(), $defaultTz,
|
$this->assertEquals($user->getTimeZone(), new DateTimeZone($defaultTz),
|
||||||
'User\'s timezone does not match the default timezone'
|
'User\'s timezone does not match the default timezone'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -64,7 +65,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
|||||||
'timezone' => $explicitTz
|
'timezone' => $explicitTz
|
||||||
));
|
));
|
||||||
$user->setPreferences($prefs);
|
$user->setPreferences($prefs);
|
||||||
$this->assertEquals($user->getTimeZone(), $explicitTz,
|
$this->assertEquals($user->getTimeZone(), new DateTimeZone($defaultTz),
|
||||||
'User\'s timezone does not match the timezone set by himself'
|
'User\'s timezone does not match the timezone set by himself'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user