public function provideGetRevisionTextWithLegacyEncoding() {
yield 'Utf8Native' => [
"Wiki est l'\xc3\xa9cole superieur !",
- 'fr',
'iso-8859-1',
(object)[
'old_flags' => 'utf-8',
];
yield 'Utf8Legacy' => [
"Wiki est l'\xc3\xa9cole superieur !",
- 'fr',
'iso-8859-1',
(object)[
'old_flags' => '',
* @covers Revision::getRevisionText
* @dataProvider provideGetRevisionTextWithLegacyEncoding
*/
- public function testGetRevisionWithLegacyEncoding( $expected, $lang, $encoding, $rowData ) {
+ public function testGetRevisionWithLegacyEncoding( $expected, $encoding, $rowData ) {
$blobStore = $this->getBlobStore();
- $blobStore->setLegacyEncoding( $encoding, Language::factory( $lang ) );
+ $blobStore->setLegacyEncoding( $encoding );
$this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
$this->testGetRevisionText( $expected, $rowData );
*/
yield 'Utf8NativeGzip' => [
"Wiki est l'\xc3\xa9cole superieur !",
- 'fr',
'iso-8859-1',
(object)[
'old_flags' => 'gzip,utf-8',
];
yield 'Utf8LegacyGzip' => [
"Wiki est l'\xc3\xa9cole superieur !",
- 'fr',
'iso-8859-1',
(object)[
'old_flags' => 'gzip',
* @covers Revision::getRevisionText
* @dataProvider provideGetRevisionTextWithGzipAndLegacyEncoding
*/
- public function testGetRevisionWithGzipAndLegacyEncoding( $expected, $lang, $encoding, $rowData ) {
+ public function testGetRevisionWithGzipAndLegacyEncoding( $expected, $encoding, $rowData ) {
$this->checkPHPExtension( 'zlib' );
$blobStore = $this->getBlobStore();
- $blobStore->setLegacyEncoding( $encoding, Language::factory( $lang ) );
+ $blobStore->setLegacyEncoding( $encoding );
$this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );
$this->testGetRevisionText( $expected, $rowData );
public function testDecompressRevisionText( $legacyEncoding, $text, $flags, $expected ) {
$blobStore = $this->getBlobStore();
if ( $legacyEncoding ) {
- $blobStore->setLegacyEncoding( $legacyEncoding, Language::factory( 'en' ) );
+ $blobStore->setLegacyEncoding( $legacyEncoding );
}
$this->setService( 'BlobStoreFactory', $this->mockBlobStoreFactory( $blobStore ) );