aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2022-11-10 20:10:49 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2022-11-10 20:10:49 +0000
commit8a6ab5bccd600d2be18a7517bc106fe330e600ec (patch)
treec8b5e82082250909014387aa428892dc6626d806 /tests/phpunit
parentadc70adc8929e545fc94bed41adeafd296233c45 (diff)
parent27ee63f8c9d97ecc04cee0d7a29deca74b7bea5c (diff)
downloadmediawikicore-8a6ab5bccd600d2be18a7517bc106fe330e600ec.tar.gz
mediawikicore-8a6ab5bccd600d2be18a7517bc106fe330e600ec.zip
Merge "Remove pre PHP 7.4 serialize()/unserialize()"
Diffstat (limited to 'tests/phpunit')
-rw-r--r--tests/phpunit/includes/MessageTest.php4
-rw-r--r--tests/phpunit/includes/auth/AuthManagerTest.php2
-rw-r--r--tests/phpunit/includes/site/SiteImporterTest.php2
-rw-r--r--tests/phpunit/includes/site/SiteListTest.php3
-rw-r--r--tests/phpunit/includes/site/SiteTest.php6
-rw-r--r--tests/phpunit/unit/includes/libs/MapCacheLRUTest.php4
6 files changed, 10 insertions, 11 deletions
diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php
index 512ebc5d9894..cb01481f4cb2 100644
--- a/tests/phpunit/includes/MessageTest.php
+++ b/tests/phpunit/includes/MessageTest.php
@@ -897,8 +897,8 @@ class MessageTest extends MediaWikiLangTestCase {
}
/**
- * @covers Message::serialize
- * @covers Message::unserialize
+ * @covers Message::__serialize
+ * @covers Message::__unserialize
*/
public function testSerialization() {
$msg = new Message( 'parentheses' );
diff --git a/tests/phpunit/includes/auth/AuthManagerTest.php b/tests/phpunit/includes/auth/AuthManagerTest.php
index 38e6d2d74d6c..87aed05489ef 100644
--- a/tests/phpunit/includes/auth/AuthManagerTest.php
+++ b/tests/phpunit/includes/auth/AuthManagerTest.php
@@ -162,7 +162,7 @@ class AuthManagerTest extends \MediaWikiIntegrationTestCase {
$name = $prop->getName();
$usedMsg = ltrim( "$msg ($name)" );
if ( $name === 'message' && $expected->message ) {
- $this->assertSame( $expected->message->serialize(), $actual->message->serialize(),
+ $this->assertSame( $expected->message->__serialize(), $actual->message->__serialize(),
$usedMsg );
} else {
$this->assertEquals( $expected->$name, $actual->$name, $usedMsg );
diff --git a/tests/phpunit/includes/site/SiteImporterTest.php b/tests/phpunit/includes/site/SiteImporterTest.php
index 7ed1b0640dc1..02e675d7d84b 100644
--- a/tests/phpunit/includes/site/SiteImporterTest.php
+++ b/tests/phpunit/includes/site/SiteImporterTest.php
@@ -186,7 +186,7 @@ class SiteImporterTest extends MediaWikiIntegrationTestCase {
foreach ( $sites as $site ) {
$key = $site->getGlobalId();
- $data = unserialize( $site->serialize() );
+ $data = unserialize( serialize( $site ) );
$serialized[$key] = $data;
}
diff --git a/tests/phpunit/includes/site/SiteListTest.php b/tests/phpunit/includes/site/SiteListTest.php
index 9912da69e6b3..dcef807f3bf4 100644
--- a/tests/phpunit/includes/site/SiteListTest.php
+++ b/tests/phpunit/includes/site/SiteListTest.php
@@ -209,7 +209,8 @@ class SiteListTest extends MediaWikiIntegrationTestCase {
*
* @param SiteList $list
* @covers SiteList::getSerializationData
- * @covers SiteList::unserialize
+ * @covers SiteList::__serialize
+ * @covers SiteList::__unserialize
*/
public function testSerialization( SiteList $list ) {
$serialization = serialize( $list );
diff --git a/tests/phpunit/includes/site/SiteTest.php b/tests/phpunit/includes/site/SiteTest.php
index 1d3d753bc2f9..84ef0d3e47e4 100644
--- a/tests/phpunit/includes/site/SiteTest.php
+++ b/tests/phpunit/includes/site/SiteTest.php
@@ -284,12 +284,10 @@ class SiteTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider instanceProvider
* @param Site $site
- * @covers Site::serialize
- * @covers Site::unserialize
+ * @covers Site::__serialize
+ * @covers Site::__unserialize
*/
public function testSerialization( Site $site ) {
- $this->assertInstanceOf( Serializable::class, $site );
-
$serialization = serialize( $site );
$newInstance = unserialize( $serialization );
diff --git a/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php b/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php
index 9020c67ce8ab..66de987e4002 100644
--- a/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php
+++ b/tests/phpunit/unit/includes/libs/MapCacheLRUTest.php
@@ -49,8 +49,8 @@ class MapCacheLRUTest extends PHPUnit\Framework\TestCase {
}
/**
- * @covers MapCacheLRU::serialize()
- * @covers MapCacheLRU::unserialize()
+ * @covers MapCacheLRU::__serialize()
+ * @covers MapCacheLRU::__unserialize()
*/
public function testSerialize() {
$cache = new MapCacheLRU( 3 );