Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/time/__tests__/PhabricatorTimeTestCase.php
| Show All 9 Lines | public function testPhabricatorTimeStack() { | ||||
| unset($time); | unset($time); | ||||
| $this->assertFalse(PhabricatorTime::getNow() === $t); | $this->assertFalse(PhabricatorTime::getNow() === $t); | ||||
| } | } | ||||
| public function testParseLocalTime() { | public function testParseLocalTime() { | ||||
| $u = new PhabricatorUser(); | $u = new PhabricatorUser(); | ||||
| $u->setTimezoneIdentifier('UTC'); | $u->overrideTimezoneIdentifier('UTC'); | ||||
| $v = new PhabricatorUser(); | $v = new PhabricatorUser(); | ||||
| $v->setTimezoneIdentifier('America/Los_Angeles'); | $v->overrideTimezoneIdentifier('America/Los_Angeles'); | ||||
| $t = 1370202281; // 2013-06-02 12:44:41 -0700 | $t = 1370202281; // 2013-06-02 12:44:41 -0700 | ||||
| $time = PhabricatorTime::pushTime($t, 'America/Los_Angeles'); | $time = PhabricatorTime::pushTime($t, 'America/Los_Angeles'); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| $t, | $t, | ||||
| PhabricatorTime::parseLocalTime('now', $u)); | PhabricatorTime::parseLocalTime('now', $u)); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| ▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines | |||||