}
/**
- * @covers SqlBlobStore::getCompressBlobs()
- * @covers SqlBlobStore::setCompressBlobs()
+ * @covers \MediaWiki\Storage\SqlBlobStore::getCompressBlobs()
+ * @covers \MediaWiki\Storage\SqlBlobStore::setCompressBlobs()
*/
public function testGetSetCompressRevisions() {
$store = $this->getBlobStore();
}
/**
- * @covers SqlBlobStore::getLegacyEncoding()
- * @covers SqlBlobStore::getLegacyEncodingConversionLang()
- * @covers SqlBlobStore::setLegacyEncoding()
+ * @covers \MediaWiki\Storage\SqlBlobStore::getLegacyEncoding()
+ * @covers \MediaWiki\Storage\SqlBlobStore::getLegacyEncodingConversionLang()
+ * @covers \MediaWiki\Storage\SqlBlobStore::setLegacyEncoding()
*/
public function testGetSetLegacyEncoding() {
$store = $this->getBlobStore();
}
/**
- * @covers SqlBlobStore::getCacheExpiry()
- * @covers SqlBlobStore::setCacheExpiry()
+ * @covers \MediaWiki\Storage\SqlBlobStore::getCacheExpiry()
+ * @covers \MediaWiki\Storage\SqlBlobStore::setCacheExpiry()
*/
public function testGetSetCacheExpiry() {
$store = $this->getBlobStore();
}
/**
- * @covers SqlBlobStore::getUseExternalStore()
- * @covers SqlBlobStore::setUseExternalStore()
+ * @covers \MediaWiki\Storage\SqlBlobStore::getUseExternalStore()
+ * @covers \MediaWiki\Storage\SqlBlobStore::setUseExternalStore()
*/
public function testGetSetUseExternalStore() {
$store = $this->getBlobStore();
];
yield '(ISO-8859-1 encoding), string in string out' => [
'ISO-8859-1',
- iconv( 'utf8', 'ISO-8859-1', "1®Àþ1" ),
+ iconv( 'utf-8', 'ISO-8859-1', "1®Àþ1" ),
[],
'1®Àþ1',
];
yield '(ISO-8859-1 encoding), serialized object in with gzip flags returns string' => [
'ISO-8859-1',
- gzdeflate( iconv( 'utf8', 'ISO-8859-1', "4®Àþ4" ) ),
+ gzdeflate( iconv( 'utf-8', 'ISO-8859-1', "4®Àþ4" ) ),
[ 'gzip' ],
'4®Àþ4',
];
yield '(ISO-8859-1 encoding), serialized object in with object flags returns string' => [
'ISO-8859-1',
- serialize( new TitleValue( 0, iconv( 'utf8', 'ISO-8859-1', "3®Àþ3" ) ) ),
+ serialize( new TitleValue( 0, iconv( 'utf-8', 'ISO-8859-1', "3®Àþ3" ) ) ),
[ 'object' ],
'3®Àþ3',
];
yield '(ISO-8859-1 encoding), serialized object in with object & gzip flags returns string' => [
'ISO-8859-1',
- gzdeflate( serialize( new TitleValue( 0, iconv( 'utf8', 'ISO-8859-1', "2®Àþ2" ) ) ) ),
+ gzdeflate( serialize( new TitleValue( 0, iconv( 'utf-8', 'ISO-8859-1', "2®Àþ2" ) ) ) ),
[ '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',
+ ];
}
/**
* @dataProvider provideDecompress
- * @covers SqlBlobStore::decompressData
+ * @covers \MediaWiki\Storage\SqlBlobStore::decompressData
*
* @param string|bool $legacyEncoding
* @param mixed $data
}
/**
- * @covers SqlBlobStore::compressData
+ * @covers \MediaWiki\Storage\SqlBlobStore::compressData
*/
public function testCompressRevisionTextUtf8() {
$store = $this->getBlobStore();
}
/**
- * @covers SqlBlobStore::compressData
+ * @covers \MediaWiki\Storage\SqlBlobStore::compressData
*/
public function testCompressRevisionTextUtf8Gzip() {
$store = $this->getBlobStore( false, true );
public function provideBlobs() {
yield [ '' ];
yield [ 'someText' ];
+ yield [ "sammansättningar" ];
}
/**
* @dataProvider provideBlobs
- * @covers SqlBlobStore::storeBlob
- * @covers SqlBlobStore::getBlob
+ * @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
+ * @covers \MediaWiki\Storage\SqlBlobStore::getBlob
*/
public function testSimpleStoreGetBlobSimpleRoundtrip( $blob ) {
$store = $this->getBlobStore();
$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 ) );
+ }
+
}