setPreferences($prefs); $this->assertEquals($user->getTimeZone(), new DateTimeZone(date_default_timezone_get()), 'User\'s timezone does not match the default timezone' ); } public function testGetTimezoneIfTimezoneSet() { $explicitTz = 'Europe/Berlin'; $user = new User('unittest'); $prefs = new Preferences(array( 'timezone' => $explicitTz )); $user->setPreferences($prefs); $this->assertEquals($user->getTimeZone(), new DateTimeZone($explicitTz), 'User\'s timezone does not match the timezone set by himself' ); } }