]> git.mxchange.org Git - friendica.git/commitdiff
Fix PHPUnit 10 deprecations
authorPhilipp <admin@philipp.info>
Wed, 5 Jul 2023 19:43:03 +0000 (21:43 +0200)
committerPhilipp <admin@philipp.info>
Wed, 5 Jul 2023 21:15:23 +0000 (23:15 +0200)
tests/Util/Database/StaticDatabase.php
tests/src/App/BaseURLTest.php
tests/src/Content/Text/BBCodeTest.php
tests/src/Model/User/CookieTest.php

index be2ec99f0bbf396eb8c88d3e6cc7b4d67d56c401..3ae497e9af553542b1c949d08810125de1f4b60c 100644 (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;
        }
index e45b30b20addead40cad83d568a4de297f8f7b46..fb79fd4d3ce3c81063f18d1e9097eed8ee052780 100644 (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' => [
index 889b12caa27d6862dc56e9c05208ec0c6d8357a2..fc8fd4bff5004d402344a88dcc5e4181b9dc50d0 100644 (file)
@@ -28,6 +28,9 @@ use Friendica\Test\FixtureTest;
 
 class BBCodeTest extends FixtureTest
 {
+       /** @var \HTMLPurifier */
+       public $HTMLPurifier;
+
        protected function setUp(): void
        {
                parent::setUp();
index 372645bf3f21ba48c4fb5235c1a0cd3e7f4668e7..ebe78764bab1999ce1ad652a6d3e6a477fc6d368 100644 (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);