Fix PHPUnit 10 deprecations

This commit is contained in:
Philipp 2023-07-05 21:43:03 +02:00
parent 037dac988e
commit 5fbdcd4a26
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
4 changed files with 8 additions and 5 deletions

View File

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

View File

@ -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' => [

View File

@ -28,6 +28,9 @@ use Friendica\Test\FixtureTest;
class BBCodeTest extends FixtureTest
{
/** @var \HTMLPurifier */
public $HTMLPurifier;
protected function setUp(): void
{
parent::setUp();

View File

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