public function testStoreTime() {
$dt = new \DateTime('now');
for ($i = 0; $i < 3; $i++) {
$dt
->modify('+1 minute');
$profile = new Profile('time_' . $i);
$profile
->setIp('127.0.0.1');
$profile
->setUrl('http://foo.bar');
$profile
->setTime($dt
->getTimestamp());
$profile
->setMethod('GET');
$this
->getStorage()
->write($profile);
}
$records = $this
->getStorage()
->find('', '', 3, 'GET');
$this
->assertCount(3, $records, '->find() returns all previously added records');
$this
->assertEquals($records[0]['token'], 'time_2', '->find() returns records ordered by time in descendant order');
$this
->assertEquals($records[1]['token'], 'time_1', '->find() returns records ordered by time in descendant order');
$this
->assertEquals($records[2]['token'], 'time_0', '->find() returns records ordered by time in descendant order');
}