Addshore has uploaded a new change for review. ( 
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, 36 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/403754/1

diff --git a/tests/phpunit/includes/Storage/SqlBlobStoreTest.php 
b/tests/phpunit/includes/Storage/SqlBlobStoreTest.php
index 6d2b09b..1d2d0f8 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',
+               ];
        }
 
        /**
@@ -187,9 +199,11 @@
                        gzinflate( $row->old_text ), "Direct check" );
        }
 
+
        public function provideBlobs() {
                yield [ '' ];
                yield [ 'someText' ];
+               yield [ "sammansättningar" ];
        }
 
        /**
@@ -203,4 +217,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: newchange
Gerrit-Change-Id: Ida717dbe6ae742b3b61f0f09dc60712307c53a96
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>

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

Reply via email to