@@ -213,26 +213,25 @@ public function testRetrieveByUrl()
213
213
214
214
public function testStoreTime ()
215
215
{
216
- $ dt = new \DateTime ('now ' );
217
- $ start = $ dt ->getTimestamp ();
216
+ $ start = $ now = time ();
218
217
219
218
for ($ i = 0 ; $ i < 3 ; ++$ i ) {
220
- $ dt -> modify ( ' +1 minute ' ) ;
219
+ $ now += 60 ;
221
220
$ profile = new Profile ('time_ ' .$ i );
222
221
$ profile ->setIp ('127.0.0.1 ' );
223
222
$ profile ->setUrl ('http://foo.bar ' );
224
- $ profile ->setTime ($ dt -> getTimestamp () );
223
+ $ profile ->setTime ($ now );
225
224
$ profile ->setMethod ('GET ' );
226
225
$ this ->storage ->write ($ profile );
227
226
}
228
227
229
- $ records = $ this ->storage ->find ('' , '' , 3 , 'GET ' , $ start , time () + 3 * 60 );
228
+ $ records = $ this ->storage ->find ('' , '' , 3 , 'GET ' , $ start , $ start + 3 * 60 );
230
229
$ this ->assertCount (3 , $ records , '->find() returns all previously added records ' );
231
230
$ this ->assertEquals ('time_2 ' , $ records [0 ]['token ' ], '->find() returns records ordered by time in descendant order ' );
232
231
$ this ->assertEquals ('time_1 ' , $ records [1 ]['token ' ], '->find() returns records ordered by time in descendant order ' );
233
232
$ this ->assertEquals ('time_0 ' , $ records [2 ]['token ' ], '->find() returns records ordered by time in descendant order ' );
234
233
235
- $ records = $ this ->storage ->find ('' , '' , 3 , 'GET ' , $ start , time () + 2 * 60 );
234
+ $ records = $ this ->storage ->find ('' , '' , 3 , 'GET ' , $ start , $ start + 2 * 60 );
236
235
$ this ->assertCount (2 , $ records , '->find() should return only first two of the previously added records ' );
237
236
}
238
237
0 commit comments