[ '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',
+ ];
}
/**
public function provideBlobs() {
yield [ '' ];
yield [ 'someText' ];
+ yield [ "sammansättningar" ];
}
/**
$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 ) );
+ }
+
}