Merge branch 'MDL-54008_30' of git://github.com/dmonllao/moodle into MOODLE_30_STABLE
This commit is contained in:
@@ -532,7 +532,6 @@ class core_date {
|
||||
}
|
||||
|
||||
// Legacy Moodle half an hour offsets - pick any city nearby, ideally without DST.
|
||||
self::$badzones['-4.5'] = 'America/Caracas';
|
||||
self::$badzones['4.5'] = 'Asia/Kabul';
|
||||
self::$badzones['5.5'] = 'Asia/Kolkata';
|
||||
self::$badzones['6.5'] = 'Asia/Rangoon';
|
||||
|
||||
@@ -142,10 +142,9 @@ class core_date_legacy_testcase extends advanced_testcase {
|
||||
$this->assertSame(60 * 60 * 1, get_timezone_offset('Europe/Prague'));
|
||||
$this->assertSame(60 * 60 * 8, get_timezone_offset('Australia/Perth'));
|
||||
$this->assertSame(60 * 60 * 12, get_timezone_offset('Pacific/Auckland'));
|
||||
$this->assertSame(60 * 60 * -4, get_timezone_offset('-4'));
|
||||
|
||||
// Known half an hour offsets.
|
||||
$this->assertEquals(60 * 60 * -4.5, get_timezone_offset('-4.5'));
|
||||
$this->assertEquals(60 * 60 * -4.5, get_timezone_offset('America/Caracas'));
|
||||
$this->assertEquals(60 * 60 * 4.5, get_timezone_offset('4.5'));
|
||||
$this->assertEquals(60 * 60 * 4.5, get_timezone_offset('Asia/Kabul'));
|
||||
$this->assertEquals(60 * 60 * 5.5, get_timezone_offset('5.5'));
|
||||
|
||||
@@ -67,6 +67,7 @@ class core_date_testcase extends advanced_testcase {
|
||||
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('2.0'));
|
||||
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone(-2));
|
||||
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone('-2.0'));
|
||||
$this->assertSame('Etc/GMT+4', core_date::normalise_timezone(-4));
|
||||
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('UTC+2'));
|
||||
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone('UTC-2'));
|
||||
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('GMT+2'));
|
||||
@@ -78,7 +79,6 @@ class core_date_testcase extends advanced_testcase {
|
||||
$this->assertSame('Etc/GMT-13', core_date::normalise_timezone(13));
|
||||
$this->assertSame('Pacific/Auckland', core_date::normalise_timezone(14));
|
||||
|
||||
$this->assertSame('America/Caracas', core_date::normalise_timezone(-4.5));
|
||||
$this->assertSame('Asia/Kabul', core_date::normalise_timezone(4.5));
|
||||
$this->assertSame('Asia/Kolkata', core_date::normalise_timezone(5.5));
|
||||
$this->assertSame('Asia/Rangoon', core_date::normalise_timezone(6.5));
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ For terms of use, see http://www.unicode.org/copyright.html
|
||||
<mapZone other="US Eastern Standard Time" territory="001" type="America/Indianapolis"/>
|
||||
<mapZone other="US Eastern Standard Time" territory="US" type="America/Indianapolis America/Indiana/Marengo America/Indiana/Vevay"/>
|
||||
|
||||
<!-- (UTC-04:30) Caracas -->
|
||||
<!-- (UTC-04:00) Caracas -->
|
||||
<mapZone other="Venezuela Standard Time" territory="001" type="America/Caracas"/>
|
||||
<mapZone other="Venezuela Standard Time" territory="VE" type="America/Caracas"/>
|
||||
|
||||
@@ -672,4 +672,4 @@ For terms of use, see http://www.unicode.org/copyright.html
|
||||
<mapZone other="Line Islands Standard Time" territory="ZZ" type="Etc/GMT-14"/>
|
||||
</mapTimezones>
|
||||
</windowsZones>
|
||||
</supplementalData>
|
||||
</supplementalData>
|
||||
|
||||
@@ -127,7 +127,7 @@ class core_scheduled_task_testcase extends advanced_testcase {
|
||||
// The timezones used in this test are chosen because they do not use DST - that would break the test.
|
||||
$this->resetAfterTest();
|
||||
|
||||
$this->setTimezone('America/Caracas');
|
||||
$this->setTimezone('Asia/Kabul');
|
||||
|
||||
$testclass = new \core\task\scheduled_test_task();
|
||||
|
||||
@@ -143,9 +143,9 @@ class core_scheduled_task_testcase extends advanced_testcase {
|
||||
$userdate = userdate($nexttime);
|
||||
|
||||
// Should be displayed in user timezone.
|
||||
// I used http://www.timeanddate.com/worldclock/fixedtime.html?msg=Moodle+Test&iso=20140314T01&p1=58
|
||||
// to verify this time.
|
||||
$this->assertContains('11:15 AM', core_text::strtoupper($userdate));
|
||||
// I used http://www.timeanddate.com/worldclock/fixedtime.html?msg=Moodle+Test&iso=20160502T01&p1=113
|
||||
// setting my location to Kathmandu to verify this time.
|
||||
$this->assertContains('2:15 AM', core_text::strtoupper($userdate));
|
||||
}
|
||||
|
||||
public function test_reset_scheduled_tasks_for_component() {
|
||||
|
||||
Reference in New Issue
Block a user