mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-23 05:35:13 +03:00
Use assertEqualsWithDelta for float comparisons
PHPUnit 7.3 introduced the functions assertEqualsWithDelta for comparing floats with a delta. The old four-argument version of assertEquals is deprecated in PHPUnit 8 and removed in PHPUnit 9. This commit means that the tests will fail with PHPUnit < 7.3 because assertEqualsWithDelta is not defined there.
This commit is contained in:
parent
43fd2a7423
commit
14dba39157
@ -98,8 +98,8 @@ class LibTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
foreach ($aQueries as $sQuery) {
|
||||
$aRes = parseLatLon($sQuery);
|
||||
$this->assertEquals(40.446, $aRes[1], 'degrees decimal ' . $sQuery, 0.01);
|
||||
$this->assertEquals(-79.982, $aRes[2], 'degrees decimal ' . $sQuery, 0.01);
|
||||
$this->assertEqualsWithDelta(40.446, $aRes[1], 0.01, 'degrees decimal ' . $sQuery);
|
||||
$this->assertEqualsWithDelta(-79.982, $aRes[2], 0.01, 'degrees decimal ' . $sQuery);
|
||||
$this->assertEquals($sQuery, $aRes[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user