mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 22:12:45 +03:00
Merge pull request #1782 from Simon-Will/1781-make-tests-work-with-phpunit-8
Make tests work with phpunit 8
This commit is contained in:
commit
b45411f988
@ -57,7 +57,7 @@ For running tests:
|
||||
|
||||
* [behave](http://pythonhosted.org/behave/)
|
||||
* [nose](https://nose.readthedocs.io)
|
||||
* [phpunit](https://phpunit.de)
|
||||
* [phpunit](https://phpunit.de) >= 7.3
|
||||
|
||||
### Hardware
|
||||
|
||||
|
@ -9,7 +9,7 @@ require_once(CONST_BasePath.'/lib/AddressDetails.php');
|
||||
class AddressDetailsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
// How the fixture got created
|
||||
//
|
||||
|
@ -7,7 +7,7 @@ require_once(CONST_BasePath.'/lib/DebugHtml.php');
|
||||
class DebugTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->oWithDebuginfo = $this->getMockBuilder(\GeococdeMock::class)
|
||||
->setMethods(array('debugInfo'))
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ class SearchContextTest extends \PHPUnit\Framework\TestCase
|
||||
private $oCtx;
|
||||
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->oCtx = new SearchContext();
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ require_once(CONST_BasePath.'/lib/TokenList.php');
|
||||
|
||||
class TokenTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->oNormalizer = $this->getMockBuilder(\MockNormalizer::class)
|
||||
->setMethods(array('transliterate'))
|
||||
|
@ -34,15 +34,18 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
|
||||
python3-psycopg2 python3-tidylib git
|
||||
|
||||
# If you want to run the test suite, you need to install the following
|
||||
# additional packages:
|
||||
|
||||
sudo apt-get install -y phpunit php-cgi
|
||||
# additional packages including the PHP package manager composer:
|
||||
|
||||
pip3 install --user behave nose
|
||||
|
||||
sudo apt-get install -y composer php-cgi php-cli php-mbstring php-xml zip unzip
|
||||
|
||||
composer global require "squizlabs/php_codesniffer=*"
|
||||
sudo ln -s ~/.config/composer/vendor/bin/phpcs /usr/bin/
|
||||
|
||||
composer global require "phpunit/phpunit=8.*"
|
||||
sudo ln -s ~/.config/composer/vendor/bin/phpunit /usr/bin/
|
||||
|
||||
#
|
||||
# System Configuration
|
||||
# ====================
|
||||
|
Loading…
Reference in New Issue
Block a user