2017-11-15 12:02:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Tests\Storage;
|
|
|
|
|
|
2018-04-11 17:07:03 +00:00
|
|
|
use InvalidArgumentException;
|
2017-11-15 12:02:40 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2019-08-26 20:18:50 +00:00
|
|
|
use MediaWiki\Storage\BlobAccessException;
|
2017-11-15 12:02:40 +00:00
|
|
|
use MediaWiki\Storage\SqlBlobStore;
|
|
|
|
|
use MediaWikiTestCase;
|
|
|
|
|
use stdClass;
|
|
|
|
|
use TitleValue;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore
|
|
|
|
|
* @group Database
|
|
|
|
|
*/
|
|
|
|
|
class SqlBlobStoreTest extends MediaWikiTestCase {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return SqlBlobStore
|
|
|
|
|
*/
|
|
|
|
|
public function getBlobStore( $legacyEncoding = false, $compressRevisions = false ) {
|
|
|
|
|
$services = MediaWikiServices::getInstance();
|
|
|
|
|
|
|
|
|
|
$store = new SqlBlobStore(
|
|
|
|
|
$services->getDBLoadBalancer(),
|
2018-02-27 06:24:46 +00:00
|
|
|
$services->getExternalStoreAccess(),
|
2017-11-15 12:02:40 +00:00
|
|
|
$services->getMainWANObjectCache()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ( $compressRevisions ) {
|
|
|
|
|
$store->setCompressBlobs( $compressRevisions );
|
|
|
|
|
}
|
|
|
|
|
if ( $legacyEncoding ) {
|
2019-10-01 16:20:45 +00:00
|
|
|
$store->setLegacyEncoding( $legacyEncoding );
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $store;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getCompressBlobs()
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::setCompressBlobs()
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testGetSetCompressRevisions() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertFalse( $store->getCompressBlobs() );
|
|
|
|
|
$store->setCompressBlobs( true );
|
|
|
|
|
$this->assertTrue( $store->getCompressBlobs() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getLegacyEncoding()
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getLegacyEncodingConversionLang()
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::setLegacyEncoding()
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testGetSetLegacyEncoding() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertFalse( $store->getLegacyEncoding() );
|
2019-10-01 16:20:45 +00:00
|
|
|
$store->setLegacyEncoding( 'foo' );
|
2017-11-15 12:02:40 +00:00
|
|
|
$this->assertSame( 'foo', $store->getLegacyEncoding() );
|
2019-10-01 16:20:45 +00:00
|
|
|
|
|
|
|
|
$this->hideDeprecated( SqlBlobStore::class . '::getLegacyEncodingConversionLang' );
|
|
|
|
|
$this->assertNull( $store->getLegacyEncodingConversionLang() );
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getCacheExpiry()
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::setCacheExpiry()
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testGetSetCacheExpiry() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertSame( 604800, $store->getCacheExpiry() );
|
|
|
|
|
$store->setCacheExpiry( 12 );
|
|
|
|
|
$this->assertSame( 12, $store->getCacheExpiry() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getUseExternalStore()
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::setUseExternalStore()
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testGetSetUseExternalStore() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertFalse( $store->getUseExternalStore() );
|
|
|
|
|
$store->setUseExternalStore( true );
|
|
|
|
|
$this->assertTrue( $store->getUseExternalStore() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideDecompress() {
|
|
|
|
|
yield '(no legacy encoding), empty in empty out' => [ false, '', [], '' ];
|
|
|
|
|
yield '(no legacy encoding), empty in empty out' => [ false, 'A', [], 'A' ];
|
2018-01-12 15:03:47 +00:00
|
|
|
yield '(no legacy encoding), error flag -> false' => [ false, 'X', [ 'error' ], false ];
|
2017-11-15 12:02:40 +00:00
|
|
|
yield '(no legacy encoding), string in with gzip flag returns string' => [
|
|
|
|
|
// gzip string below generated with gzdeflate( 'AAAABBAAA' )
|
|
|
|
|
false, "sttttr\002\022\000", [ 'gzip' ], 'AAAABBAAA',
|
|
|
|
|
];
|
|
|
|
|
yield '(no legacy encoding), string in with object flag returns false' => [
|
|
|
|
|
// gzip string below generated with serialize( 'JOJO' )
|
|
|
|
|
false, "s:4:\"JOJO\";", [ 'object' ], false,
|
|
|
|
|
];
|
|
|
|
|
yield '(no legacy encoding), serialized object in with object flag returns string' => [
|
|
|
|
|
false,
|
|
|
|
|
// Using a TitleValue object as it has a getText method (which is needed)
|
|
|
|
|
serialize( new TitleValue( 0, 'HHJJDDFF' ) ),
|
|
|
|
|
[ 'object' ],
|
|
|
|
|
'HHJJDDFF',
|
|
|
|
|
];
|
|
|
|
|
yield '(no legacy encoding), serialized object in with object & gzip flag returns string' => [
|
|
|
|
|
false,
|
|
|
|
|
// Using a TitleValue object as it has a getText method (which is needed)
|
|
|
|
|
gzdeflate( serialize( new TitleValue( 0, '8219JJJ840' ) ) ),
|
|
|
|
|
[ 'object', 'gzip' ],
|
|
|
|
|
'8219JJJ840',
|
|
|
|
|
];
|
|
|
|
|
yield '(ISO-8859-1 encoding), string in string out' => [
|
|
|
|
|
'ISO-8859-1',
|
2017-12-15 18:56:48 +00:00
|
|
|
iconv( 'utf-8', 'ISO-8859-1', "1®Àþ1" ),
|
2017-11-15 12:02:40 +00:00
|
|
|
[],
|
|
|
|
|
'1®Àþ1',
|
|
|
|
|
];
|
|
|
|
|
yield '(ISO-8859-1 encoding), serialized object in with gzip flags returns string' => [
|
|
|
|
|
'ISO-8859-1',
|
2017-12-15 18:56:48 +00:00
|
|
|
gzdeflate( iconv( 'utf-8', 'ISO-8859-1', "4®Àþ4" ) ),
|
2017-11-15 12:02:40 +00:00
|
|
|
[ 'gzip' ],
|
|
|
|
|
'4®Àþ4',
|
|
|
|
|
];
|
|
|
|
|
yield '(ISO-8859-1 encoding), serialized object in with object flags returns string' => [
|
|
|
|
|
'ISO-8859-1',
|
2017-12-15 18:56:48 +00:00
|
|
|
serialize( new TitleValue( 0, iconv( 'utf-8', 'ISO-8859-1', "3®Àþ3" ) ) ),
|
2017-11-15 12:02:40 +00:00
|
|
|
[ 'object' ],
|
|
|
|
|
'3®Àþ3',
|
|
|
|
|
];
|
|
|
|
|
yield '(ISO-8859-1 encoding), serialized object in with object & gzip flags returns string' => [
|
|
|
|
|
'ISO-8859-1',
|
2017-12-15 18:56:48 +00:00
|
|
|
gzdeflate( serialize( new TitleValue( 0, iconv( 'utf-8', 'ISO-8859-1', "2®Àþ2" ) ) ) ),
|
2017-11-15 12:02:40 +00:00
|
|
|
[ 'gzip', 'object' ],
|
|
|
|
|
'2®Àþ2',
|
|
|
|
|
];
|
2018-01-11 20:55:37 +00:00
|
|
|
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',
|
|
|
|
|
];
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @dataProvider provideDecompress
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::decompressData
|
2017-11-15 12:02:40 +00:00
|
|
|
*
|
|
|
|
|
* @param string|bool $legacyEncoding
|
|
|
|
|
* @param mixed $data
|
|
|
|
|
* @param array $flags
|
|
|
|
|
* @param mixed $expected
|
|
|
|
|
*/
|
|
|
|
|
public function testDecompressData( $legacyEncoding, $data, $flags, $expected ) {
|
|
|
|
|
$store = $this->getBlobStore( $legacyEncoding );
|
|
|
|
|
$this->assertSame(
|
|
|
|
|
$expected,
|
|
|
|
|
$store->decompressData( $data, $flags )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 15:03:47 +00:00
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::decompressData
|
|
|
|
|
*/
|
|
|
|
|
public function testDecompressData_InvalidArgumentException() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
|
2019-10-05 15:39:46 +00:00
|
|
|
$this->expectException( InvalidArgumentException::class );
|
2018-01-12 15:03:47 +00:00
|
|
|
$store->decompressData( false, [] );
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-15 12:02:40 +00:00
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::compressData
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testCompressRevisionTextUtf8() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$row = new stdClass;
|
|
|
|
|
$row->old_text = "Wiki est l'\xc3\xa9cole superieur !";
|
|
|
|
|
$row->old_flags = $store->compressData( $row->old_text );
|
2018-06-30 09:43:00 +00:00
|
|
|
$this->assertTrue( strpos( $row->old_flags, 'utf-8' ) !== false,
|
2017-11-15 12:02:40 +00:00
|
|
|
"Flags should contain 'utf-8'" );
|
2018-06-30 09:43:00 +00:00
|
|
|
$this->assertFalse( strpos( $row->old_flags, 'gzip' ) !== false,
|
2017-11-15 12:02:40 +00:00
|
|
|
"Flags should not contain 'gzip'" );
|
|
|
|
|
$this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !",
|
|
|
|
|
$row->old_text, "Direct check" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::compressData
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testCompressRevisionTextUtf8Gzip() {
|
|
|
|
|
$store = $this->getBlobStore( false, true );
|
|
|
|
|
$this->checkPHPExtension( 'zlib' );
|
|
|
|
|
|
|
|
|
|
$row = new stdClass;
|
|
|
|
|
$row->old_text = "Wiki est l'\xc3\xa9cole superieur !";
|
|
|
|
|
$row->old_flags = $store->compressData( $row->old_text );
|
2018-06-30 09:43:00 +00:00
|
|
|
$this->assertTrue( strpos( $row->old_flags, 'utf-8' ) !== false,
|
2017-11-15 12:02:40 +00:00
|
|
|
"Flags should contain 'utf-8'" );
|
2018-06-30 09:43:00 +00:00
|
|
|
$this->assertTrue( strpos( $row->old_flags, 'gzip' ) !== false,
|
2017-11-15 12:02:40 +00:00
|
|
|
"Flags should contain 'gzip'" );
|
|
|
|
|
$this->assertEquals( "Wiki est l'\xc3\xa9cole superieur !",
|
|
|
|
|
gzinflate( $row->old_text ), "Direct check" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideBlobs() {
|
|
|
|
|
yield [ '' ];
|
|
|
|
|
yield [ 'someText' ];
|
2018-01-11 20:55:37 +00:00
|
|
|
yield [ "sammansättningar" ];
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-08-26 20:18:50 +00:00
|
|
|
* @param string $blob
|
2017-11-15 12:02:40 +00:00
|
|
|
* @dataProvider provideBlobs
|
2017-12-15 03:20:51 +00:00
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlob
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
|
|
|
|
public function testSimpleStoreGetBlobSimpleRoundtrip( $blob ) {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$address = $store->storeBlob( $blob );
|
|
|
|
|
$this->assertSame( $blob, $store->getBlob( $address ) );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-26 20:18:50 +00:00
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlobBatch
|
|
|
|
|
*/
|
|
|
|
|
public function testSimpleStorageGetBlobBatchSimpleEmpty() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertArrayEquals(
|
|
|
|
|
[],
|
|
|
|
|
$store->getBlobBatch( [] )->getValue()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $blob
|
|
|
|
|
* @dataProvider provideBlobs
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::storeBlob
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlobBatch
|
|
|
|
|
*/
|
|
|
|
|
public function testSimpleStorageGetBlobBatchSimpleRoundtrip( $blob ) {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$addresses = [
|
|
|
|
|
$store->storeBlob( $blob ),
|
|
|
|
|
$store->storeBlob( $blob . '1' )
|
|
|
|
|
];
|
|
|
|
|
$this->assertArrayEquals(
|
|
|
|
|
array_combine( $addresses, [ $blob, $blob . '1' ] ),
|
|
|
|
|
$store->getBlobBatch( $addresses )->getValue()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlob
|
|
|
|
|
*/
|
|
|
|
|
public function testSimpleStorageNonExistentBlob() {
|
2019-10-05 15:39:46 +00:00
|
|
|
$this->expectException( BlobAccessException::class );
|
2019-08-26 20:18:50 +00:00
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$store->getBlob( 'tt:this_will_not_exist' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlobBatch
|
|
|
|
|
*/
|
|
|
|
|
public function testSimpleStorageNonExistentBlobBatch() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$result = $store->getBlobBatch( [ 'tt:this_will_not_exist', 'tt:1000', 'bla:1001' ] );
|
|
|
|
|
$this->assertSame(
|
|
|
|
|
[
|
|
|
|
|
'tt:this_will_not_exist' => null,
|
|
|
|
|
'tt:1000' => null,
|
|
|
|
|
'bla:1001' => null
|
|
|
|
|
],
|
|
|
|
|
$result->getValue()
|
|
|
|
|
);
|
|
|
|
|
$this->assertSame( [
|
|
|
|
|
[
|
|
|
|
|
'type' => 'warning',
|
|
|
|
|
'message' => 'internalerror',
|
|
|
|
|
'params' => [
|
|
|
|
|
'Bad blob address: tt:this_will_not_exist'
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'type' => 'warning',
|
|
|
|
|
'message' => 'internalerror',
|
|
|
|
|
'params' => [
|
|
|
|
|
'Unknown blob address schema: bla'
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'type' => 'warning',
|
|
|
|
|
'message' => 'internalerror',
|
|
|
|
|
'params' => [
|
|
|
|
|
'Unable to fetch blob at tt:1000'
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
], $result->getErrors() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \MediaWiki\Storage\SqlBlobStore::getBlobBatch
|
|
|
|
|
*/
|
|
|
|
|
public function testSimpleStoragePartialNonExistentBlobBatch() {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$address = $store->storeBlob( 'test_data' );
|
|
|
|
|
$result = $store->getBlobBatch( [ $address, 'tt:this_will_not_exist_too' ] );
|
|
|
|
|
$this->assertSame(
|
|
|
|
|
[
|
|
|
|
|
$address => 'test_data',
|
|
|
|
|
'tt:this_will_not_exist_too' => null
|
|
|
|
|
],
|
|
|
|
|
$result->getValue()
|
|
|
|
|
);
|
|
|
|
|
$this->assertSame( [
|
|
|
|
|
[
|
|
|
|
|
'type' => 'warning',
|
|
|
|
|
'message' => 'internalerror',
|
|
|
|
|
'params' => [
|
|
|
|
|
'Bad blob address: tt:this_will_not_exist_too'
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
], $result->getErrors() );
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-11 20:55:37 +00:00
|
|
|
/**
|
|
|
|
|
* @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 ) {
|
2018-08-01 07:25:32 +00:00
|
|
|
// FIXME: fails under postgres
|
|
|
|
|
$this->markTestSkippedIfDbType( 'postgres' );
|
2018-01-11 20:55:37 +00:00
|
|
|
$store = $this->getBlobStore( 'windows-1252', true );
|
|
|
|
|
$address = $store->storeBlob( $blob );
|
|
|
|
|
$this->assertSame( $blob, $store->getBlob( $address ) );
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-11 17:07:03 +00:00
|
|
|
public function provideGetTextIdFromAddress() {
|
|
|
|
|
yield [ 'tt:17', 17 ];
|
|
|
|
|
yield [ 'xy:17', null ];
|
|
|
|
|
yield [ 'xy:xyzzy', null ];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @dataProvider provideGetTextIdFromAddress
|
|
|
|
|
*/
|
|
|
|
|
public function testGetTextIdFromAddress( $address, $textId ) {
|
|
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$this->assertSame( $textId, $store->getTextIdFromAddress( $address ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function provideGetTextIdFromAddressInvalidArgumentException() {
|
|
|
|
|
yield [ 'tt:-17' ];
|
|
|
|
|
yield [ 'tt:xy' ];
|
|
|
|
|
yield [ 'tt:0' ];
|
|
|
|
|
yield [ 'tt:' ];
|
|
|
|
|
yield [ 'xy' ];
|
|
|
|
|
yield [ '' ];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @dataProvider provideGetTextIdFromAddressInvalidArgumentException
|
|
|
|
|
*/
|
|
|
|
|
public function testGetTextIdFromAddressInvalidArgumentException( $address ) {
|
2019-10-05 15:39:46 +00:00
|
|
|
$this->expectException( InvalidArgumentException::class );
|
2018-04-11 17:07:03 +00:00
|
|
|
$store = $this->getBlobStore();
|
|
|
|
|
$store->getTextIdFromAddress( $address );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testMakeAddressFromTextId() {
|
|
|
|
|
$this->assertSame( 'tt:17', SqlBlobStore::makeAddressFromTextId( 17 ) );
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|