[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Extra tests for SqlBlobStore with 'windows-1252' legacy enco...
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: AddshoreGerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Extra tests for SqlBlobStore with 'windows-1252' legacy enco...
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___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits