Changeset View
Changeset View
Standalone View
Standalone View
src/view/__tests__/PhabricatorLocalTimeTestCase.php
| <?php | <?php | ||||
| final class PhabricatorLocalTimeTestCase extends PhabricatorTestCase { | final class PhabricatorLocalTimeTestCase extends PhabricatorTestCase { | ||||
| public function testLocalTimeFormatting() { | public function testLocalTimeFormatting() { | ||||
| $user = new PhabricatorUser(); | $user = new PhabricatorUser(); | ||||
| $user->setTimezoneIdentifier('America/Los_Angeles'); | $user->overrideTimezoneIdentifier('America/Los_Angeles'); | ||||
| $utc = new PhabricatorUser(); | $utc = new PhabricatorUser(); | ||||
| $utc->setTimezoneIdentifier('UTC'); | $utc->overrideTimezoneIdentifier('UTC'); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| 'Jan 1 2000, 12:00 AM', | 'Jan 1 2000, 12:00 AM', | ||||
| phabricator_datetime(946684800, $utc), | phabricator_datetime(946684800, $utc), | ||||
| pht('Datetime formatting')); | pht('Datetime formatting')); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| 'Jan 1 2000', | 'Jan 1 2000', | ||||
| phabricator_date(946684800, $utc), | phabricator_date(946684800, $utc), | ||||
| Show All 18 Lines | |||||