Storage: SqlBlobStore no longer needs Language object
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionTest.php
index d62e4c7..bdb34a9 100644 (file)
@@ -281,7 +281,6 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
         */
        public function testConstructFromRowWithBadPageId() {
-               $this->overrideMwServices();
                Wikimedia\suppressWarnings();
                $rev = new Revision( (object)[
                        'rev_page' => 77777777,
@@ -488,7 +487,6 @@ class RevisionTest extends MediaWikiTestCase {
        public function provideGetRevisionTextWithLegacyEncoding() {
                yield 'Utf8Native' => [
                        "Wiki est l'\xc3\xa9cole superieur !",
-                       'fr',
                        'iso-8859-1',
                        (object)[
                                'old_flags' => 'utf-8',
@@ -497,7 +495,6 @@ class RevisionTest extends MediaWikiTestCase {
                ];
                yield 'Utf8Legacy' => [
                        "Wiki est l'\xc3\xa9cole superieur !",
-                       'fr',
                        'iso-8859-1',
                        (object)[
                                'old_flags' => '',
@@ -510,9 +507,9 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers Revision::getRevisionText
         * @dataProvider provideGetRevisionTextWithLegacyEncoding
         */
-       public function testGetRevisionWithLegacyEncoding( $expected, $lang, $encoding, $rowData ) {
+       public function testGetRevisionWithLegacyEncoding( $expected, $encoding, $rowData ) {
                $blobStore = $this->getBlobStore();
-               $blobStore->setLegacyEncoding( $encoding, Language::factory( $lang ) );
+               $blobStore->setLegacyEncoding( $encoding );
                $this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
 
                $this->testGetRevisionText( $expected, $rowData );
@@ -526,7 +523,6 @@ class RevisionTest extends MediaWikiTestCase {
                 */
                yield 'Utf8NativeGzip' => [
                        "Wiki est l'\xc3\xa9cole superieur !",
-                       'fr',
                        'iso-8859-1',
                        (object)[
                                'old_flags' => 'gzip,utf-8',
@@ -535,7 +531,6 @@ class RevisionTest extends MediaWikiTestCase {
                ];
                yield 'Utf8LegacyGzip' => [
                        "Wiki est l'\xc3\xa9cole superieur !",
-                       'fr',
                        'iso-8859-1',
                        (object)[
                                'old_flags' => 'gzip',
@@ -548,11 +543,11 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers Revision::getRevisionText
         * @dataProvider provideGetRevisionTextWithGzipAndLegacyEncoding
         */
-       public function testGetRevisionWithGzipAndLegacyEncoding( $expected, $lang, $encoding, $rowData ) {
+       public function testGetRevisionWithGzipAndLegacyEncoding( $expected, $encoding, $rowData ) {
                $this->checkPHPExtension( 'zlib' );
 
                $blobStore = $this->getBlobStore();
-               $blobStore->setLegacyEncoding( $encoding, Language::factory( $lang ) );
+               $blobStore->setLegacyEncoding( $encoding );
                $this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
 
                $this->testGetRevisionText( $expected, $rowData );
@@ -602,8 +597,6 @@ class RevisionTest extends MediaWikiTestCase {
         * @covers Revision::loadFromTitle
         */
        public function testLoadFromTitle() {
-               $this->setMwGlobals( 'wgActorTableSchemaMigrationStage', SCHEMA_COMPAT_NEW );
-               $this->overrideMwServices();
                $title = $this->getMockTitle();
 
                $conditions = [
@@ -731,7 +724,7 @@ class RevisionTest extends MediaWikiTestCase {
        public function testDecompressRevisionText( $legacyEncoding, $text, $flags, $expected ) {
                $blobStore = $this->getBlobStore();
                if ( $legacyEncoding ) {
-                       $blobStore->setLegacyEncoding( $legacyEncoding, Language::factory( 'en' ) );
+                       $blobStore->setLegacyEncoding( $legacyEncoding );
                }
 
                $this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
@@ -853,8 +846,7 @@ class RevisionTest extends MediaWikiTestCase {
                );
 
                $cacheKey = $cache->makeGlobalKey(
-                       'BlobStore',
-                       'address',
+                       'SqlBlobStore-blob',
                        $lb->getLocalDomainID(),
                        'tt:7777'
                );