Changeset 52e0022 in iPeer


Ignore:
Timestamp:
2013-08-28T11:06:53-07:00 (4 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, master
Children:
9c2832e
Parents:
8cab1df (diff), d01e64b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'timezoneBug' into dev

Conflicts:

app/tests/cases/models/event.test.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/tests/cases/models/event.test.php

    r8cab1df r52e0022  
    328328        $this->assertEqual($ids, array(1,2,3,5,6,6));
    329329    }
    330    
     330
    331331    function testGetEventSubmission()
    332332    {
    333333        //TODO
     334    }
     335
     336    function testTimezone()
     337    {
     338        $now = time(); // current php time (eg. not sql time)
     339        $event = $this->Event->findById(1);
     340        $dueDate = strtotime($event['Event']['due_date']);
     341        $dueIn = $dueDate - $now;
     342        // the difference between the our calculuation and the model's calcualtion
     343        // should be within 5 seconds
     344        $this->assertWithinMargin($event['Event']['due_in'], $dueIn, 5);
    334345    }
    335346
Note: See TracChangeset for help on using the changeset viewer.