◆ calculateNearestExpiration_validTime_correctNearestExpired()
ilGeoLocationCalculatorTest::calculateNearestExpiration_validTime_correctNearestExpired |
( |
| ) |
|
- Test:
- @small
Definition at line 12 of file ilGeoLocationCalculatorTest.php.
13 {
14 $now = microtime();
15 $before = microtime() - 1000;
16
17
18 $obj1 =
new ilGeoLocation(1,
"older", 0, 0,
new \DateTimeImmutable($before));
19 $obj2 =
new ilGeoLocation(1,
"newer", 0, 0,
new \DateTimeImmutable($now));
20 $mocked_repo = $this->createMock(ilGeoLocationRepository::class);
21 $mocked_repo->expects($this->once())
22 ->method('getGeoLocationsByCoordinates')
23 ->with(1, 2)
24 ->will($this->returnValue(array($obj1, $obj2)));
26
27
28 $result = $calc->calculateNearestExpiration(1, 2);
29
30
31 $this->assertEqual(
$result, $before);
32 }
References $result.
The documentation for this class was generated from the following file: