3 final class CalendarTimeUtilTestCase
extends PhabricatorTestCase
{
5 public function testTimestampsAtMidnight() {
6 $u = new PhabricatorUser();
7 $u->overrideTimezoneIdentifier('America/Los_Angeles');
8 $days = $this->getAllDays();
9 foreach ($days as $day) {
10 $data = CalendarTimeUtil
::getTimestamps($u, $day, 1);
14 $data['epoch_stamps'][0]->format('His'));
18 public function testTimestampsStartDay() {
19 $u = new PhabricatorUser();
20 $u->overrideTimezoneIdentifier('America/Los_Angeles');
21 $days = $this->getAllDays();
22 foreach ($days as $day) {
23 $data = CalendarTimeUtil
::getTimestamps(
30 $data['epoch_stamps'][0]->format('l'));
33 $t = 1370202281; // 2013-06-02 12:44:41 -0700 -- a Sunday
34 $time = PhabricatorTime
::pushTime($t, 'America/Los_Angeles');
35 foreach ($days as $day) {
36 $data = CalendarTimeUtil
::getTimestamps(
43 $data['epoch_stamps'][0]->format('l'));
48 private function getAllDays() {