3use PHPUnit\Framework\TestCase;
16 $before = microtime() - 1000;
19 $obj1 =
new ilGeoLocation(1,
"older", 0, 0,
new \DateTimeImmutable($before));
20 $obj2 =
new ilGeoLocation(1,
"newer", 0, 0,
new \DateTimeImmutable($now));
21 $mocked_repo = $this->createMock(ilGeoLocationRepository::class);
22 $mocked_repo->expects($this->once())
23 ->method(
'getGeoLocationsByCoordinates')
25 ->will($this->returnValue(array($obj1, $obj2)));
29 $result = $calc->calculateNearestExpiration(1, 2);
32 $this->assertEqual(
$result, $before);
calculateNearestExpiration_validTime_correctNearestExpired()