Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / view / __tests__ / PhabricatorLocalTimeTestCase.php
bloba6ab67e8c55251ff578e5bcc421f37e13d706137
1 <?php
3 final class PhabricatorLocalTimeTestCase extends PhabricatorTestCase {
5 protected function getPhabricatorTestCaseConfiguration() {
6 return array(
7 self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true,
8 );
11 public function testLocalTimeFormatting() {
12 $user = $this->generateNewTestUser();
13 $user->overrideTimezoneIdentifier('America/Los_Angeles');
15 $utc = $this->generateNewTestUser();
16 $utc->overrideTimezoneIdentifier('UTC');
18 $this->assertEqual(
19 'Jan 1 2000, 12:00 AM',
20 phabricator_datetime(946684800, $utc),
21 pht('Datetime formatting'));
22 $this->assertEqual(
23 'Jan 1 2000',
24 phabricator_date(946684800, $utc),
25 pht('Date formatting'));
26 $this->assertEqual(
27 '12:00 AM',
28 phabricator_time(946684800, $utc),
29 pht('Time formatting'));
31 $this->assertEqual(
32 'Dec 31 1999, 4:00 PM',
33 phabricator_datetime(946684800, $user),
34 pht('Localization'));
36 $this->assertEqual(
37 '',
38 phabricator_datetime(0, $user),
39 pht('Missing epoch should fail gracefully'));