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->driver = 'pdo';
$this->connection = self::$staticConnection; $this->connection = self::$staticConnection;
$this->connected = true; $this->connected = true;
$this->emulate_prepares = false;
return $this->connected; return $this->connected;
} }

View file

@ -178,7 +178,7 @@ class BaseURLTest extends MockedTest
public function testRedirectException() public function testRedirectException()
{ {
self::expectException(InternalServerErrorException::class); 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([ $config = new ReadOnlyFileConfig(new Cache([
'system' => [ 'system' => [

View file

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

View file

@ -231,11 +231,12 @@ class CookieTest extends MockedTest
$data = json_decode(StaticCookie::$_COOKIE[Cookie::NAME]); $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::assertEquals($uid, $data->uid);
self::assertObjectHasAttribute('hash', $data); self::assertTrue(property_exists($data, 'hash'));
self::assertEquals($hash, $data->hash); self::assertEquals($hash, $data->hash);
self::assertObjectHasAttribute('ip', $data); self::assertTrue(property_exists($data, 'ip'));
self::assertEquals($remoteIp, $data->ip); self::assertEquals($remoteIp, $data->ip);
self::assertLessThanOrEqual(time() + Cookie::DEFAULT_EXPIRE * 24 * 60 * 60, StaticCookie::$_EXPIRE); self::assertLessThanOrEqual(time() + Cookie::DEFAULT_EXPIRE * 24 * 60 * 60, StaticCookie::$_EXPIRE);