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:
Sarah Hoffmann 2020-05-07 22:01:35 +02:00 committed by GitHub
commit b45411f988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 10 deletions

View File

@ -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

View File

@ -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
//

View File

@ -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'))

View File

@ -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]);
}
}

View File

@ -9,7 +9,7 @@ class SearchContextTest extends \PHPUnit\Framework\TestCase
private $oCtx;
protected function setUp()
protected function setUp(): void
{
$this->oCtx = new SearchContext();
}

View File

@ -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'))

View File

@ -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
# ====================