From 1bc9fdf55352b61c278d298e9935451394230355 Mon Sep 17 00:00:00 2001 From: Tim-Hinnerk Heuer Date: Tue, 28 Sep 2021 21:12:50 +1300 Subject: A few more PHP8.1 fixes (#17989) * add return type declartions #17686 should not break anything and gets rid of a warning * add return type to method signature #17686 * annotate return types to avoid warnings * add more return types * upgrade phpmailer/phpmailer to 6.5.1 * add return types, avoid deprecated null to string conversion * fix some deprecation warnings for php 8.1 #17686 * fix in DbHelper::getInstallVersion() instead #17686 * ensure empty(DbHelper::getInstallVersion()) succeed #17686 * force return "0" string and adjust test Co-authored-by: Justin Velluppillai --- tests/PHPUnit/Integration/DbHelperTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/PHPUnit/Integration') diff --git a/tests/PHPUnit/Integration/DbHelperTest.php b/tests/PHPUnit/Integration/DbHelperTest.php index c08553ea87..57c8d0e7fe 100644 --- a/tests/PHPUnit/Integration/DbHelperTest.php +++ b/tests/PHPUnit/Integration/DbHelperTest.php @@ -40,7 +40,8 @@ class DbHelperTest extends IntegrationTestCase public function test_recordInstallVersion_setsCurrentVersion() { Option::delete(Db\Schema\Mysql::OPTION_NAME_MATOMO_INSTALL_VERSION); - $this->assertNull(DbHelper::getInstallVersion()); + $this->assertEmpty(DbHelper::getInstallVersion()); + $this->assertEquals('0', DbHelper::getInstallVersion()); // since php 8.1 this is required DbHelper::recordInstallVersion(); $this->assertSame(Version::VERSION, DbHelper::getInstallVersion()); -- cgit v1.2.3