Exemplo n.º 1
0
 public function testGetTimezoneIfTimezoneSet()
 {
     $explicitTz = 'Europe/Berlin';
     $user = new User('unittest');
     $prefs = Mockery::mock('Icinga\\User\\Preferences');
     $prefs->shouldReceive('get')->with('timezone')->andReturn($explicitTz);
     $user->setPreferences($prefs);
     $this->assertEquals(new DateTimeZone($explicitTz), $user->getTimeZone(), 'User\'s timezone does not match the timezone set by himself');
 }