ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilGeoLocationCalculatorTest Class Reference
+ Inheritance diagram for ilGeoLocationCalculatorTest:
+ Collaboration diagram for ilGeoLocationCalculatorTest:

Public Member Functions

 calculateNearestExpiration_validTime_correctNearestExpired ()
 

Detailed Description

Definition at line 6 of file ilGeoLocationCalculatorTest.php.

Member Function Documentation

◆ calculateNearestExpiration_validTime_correctNearestExpired()

ilGeoLocationCalculatorTest::calculateNearestExpiration_validTime_correctNearestExpired ( )
Test:
@small

Definition at line 13 of file ilGeoLocationCalculatorTest.php.

14 {
15 $now = microtime();
16 $before = microtime() - 1000;
17
18 // Arrange
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')
24 ->with(1, 2)
25 ->will($this->returnValue(array($obj1, $obj2)));
26 $calc = new ilGeoLocationCalculator($mocked_repo);
27
28 // Act
29 $result = $calc->calculateNearestExpiration(1, 2);
30
31 // Assert
32 $this->assertEqual($result, $before);
33 }
$result

References $result.


The documentation for this class was generated from the following file: