jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403754 )

Change subject: Extra tests for SqlBlobStore with 'windows-1252' legacy encoding
......................................................................


Extra tests for SqlBlobStore with 'windows-1252' legacy encoding

Bug: T184749
Change-Id: Ida717dbe6ae742b3b61f0f09dc60712307c53a96
---
M tests/phpunit/includes/Storage/SqlBlobStoreTest.php
1 file changed, 35 insertions(+), 0 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/includes/Storage/SqlBlobStoreTest.php 
b/tests/phpunit/includes/Storage/SqlBlobStoreTest.php
index 6d2b09b..dbbef11 100644
--- a/tests/phpunit/includes/Storage/SqlBlobStoreTest.php
+++ b/tests/phpunit/includes/Storage/SqlBlobStoreTest.php
@@ -134,6 +134,18 @@
                        [ 'gzip', 'object' ],
                        '2®Àþ2',
                ];
+               yield 'T184749 (windows-1252 encoding), string in string out' 
=> [
+                       'windows-1252',
+                       iconv( 'utf-8', 'windows-1252', "sammansättningar" ),
+                       [],
+                       'sammansättningar',
+               ];
+               yield 'T184749 (windows-1252 encoding), string in string out 
with gzip' => [
+                       'windows-1252',
+                       gzdeflate( iconv( 'utf-8', 'windows-1252', 
"sammansättningar" ) ),
+                       [ 'gzip' ],
+                       'sammansättningar',
+               ];
        }
 
        /**
@@ -190,6 +202,7 @@
        public function provideBlobs() {
                yield [ '' ];
                yield [ 'someText' ];
+               yield [ "sammansättningar" ];
        }
 
        /**
@@ -203,4 +216,26 @@
                $this->assertSame( $blob, $store->getBlob( $address ) );
        }
 
+       /**
+        * @dataProvider provideBlobs
+        * @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
+        * @covers \MediaWiki\Storage\SqlBlobStore::getBlob
+        */
+       public function 
testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncoding( $blob ) {
+               $store = $this->getBlobStore( 'windows-1252' );
+               $address = $store->storeBlob( $blob );
+               $this->assertSame( $blob, $store->getBlob( $address ) );
+       }
+
+       /**
+        * @dataProvider provideBlobs
+        * @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
+        * @covers \MediaWiki\Storage\SqlBlobStore::getBlob
+        */
+       public function 
testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncodingGzip( $blob ) {
+               $store = $this->getBlobStore( 'windows-1252', true );
+               $address = $store->storeBlob( $blob );
+               $this->assertSame( $blob, $store->getBlob( $address ) );
+       }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/403754
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida717dbe6ae742b3b61f0f09dc60712307c53a96
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to