From: Philipp Date: Wed, 5 Jul 2023 19:43:03 +0000 (+0200) Subject: Fix PHPUnit 10 deprecations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5fbdcd4a26728facad668572565722f7c8b74d9c;p=friendica.git Fix PHPUnit 10 deprecations --- diff --git a/tests/Util/Database/StaticDatabase.php b/tests/Util/Database/StaticDatabase.php index be2ec99f0b..3ae497e9af 100644 --- a/tests/Util/Database/StaticDatabase.php +++ b/tests/Util/Database/StaticDatabase.php @@ -60,7 +60,6 @@ class StaticDatabase extends Database $this->driver = 'pdo'; $this->connection = self::$staticConnection; $this->connected = true; - $this->emulate_prepares = false; return $this->connected; } diff --git a/tests/src/App/BaseURLTest.php b/tests/src/App/BaseURLTest.php index e45b30b20a..fb79fd4d3c 100644 --- a/tests/src/App/BaseURLTest.php +++ b/tests/src/App/BaseURLTest.php @@ -178,7 +178,7 @@ class BaseURLTest extends MockedTest public function testRedirectException() { self::expectException(InternalServerErrorException::class); - self::expectErrorMessage('https://friendica.other is not a relative path, please use System::externalRedirect'); + self::expectExceptionMessage('https://friendica.other is not a relative path, please use System::externalRedirect'); $config = new ReadOnlyFileConfig(new Cache([ 'system' => [ diff --git a/tests/src/Content/Text/BBCodeTest.php b/tests/src/Content/Text/BBCodeTest.php index 889b12caa2..fc8fd4bff5 100644 --- a/tests/src/Content/Text/BBCodeTest.php +++ b/tests/src/Content/Text/BBCodeTest.php @@ -28,6 +28,9 @@ use Friendica\Test\FixtureTest; class BBCodeTest extends FixtureTest { + /** @var \HTMLPurifier */ + public $HTMLPurifier; + protected function setUp(): void { parent::setUp(); diff --git a/tests/src/Model/User/CookieTest.php b/tests/src/Model/User/CookieTest.php index 372645bf3f..ebe78764ba 100644 --- a/tests/src/Model/User/CookieTest.php +++ b/tests/src/Model/User/CookieTest.php @@ -231,11 +231,12 @@ class CookieTest extends MockedTest $data = json_decode(StaticCookie::$_COOKIE[Cookie::NAME]); - self::assertObjectHasAttribute('uid', $data); + self::assertIsObject($data); + self::assertTrue(property_exists($data, 'uid')); self::assertEquals($uid, $data->uid); - self::assertObjectHasAttribute('hash', $data); + self::assertTrue(property_exists($data, 'hash')); self::assertEquals($hash, $data->hash); - self::assertObjectHasAttribute('ip', $data); + self::assertTrue(property_exists($data, 'ip')); self::assertEquals($remoteIp, $data->ip); self::assertLessThanOrEqual(time() + Cookie::DEFAULT_EXPIRE * 24 * 60 * 60, StaticCookie::$_EXPIRE);