3 namespace MediaWiki\Tests\Storage
;
5 use MediaWiki\MediaWikiServices
;
6 use MediaWiki\Storage\BlobStore
;
7 use MediaWiki\Storage\SqlBlobStore
;
9 use Wikimedia\TestingAccessWrapper
;
12 * @covers \MediaWiki\Storage\BlobStoreFactory
14 class BlobStoreFactoryTest
extends MediaWikiTestCase
{
16 public function provideWikiIds() {
22 * @dataProvider provideWikiIds
24 public function testNewBlobStore( $wikiId ) {
25 $factory = MediaWikiServices
::getInstance()->getBlobStoreFactory();
26 $store = $factory->newBlobStore( $wikiId );
27 $this->assertInstanceOf( BlobStore
::class, $store );
29 // This only works as we currently know this is a SqlBlobStore object
30 $wrapper = TestingAccessWrapper
::newFromObject( $store );
31 $this->assertEquals( $wikiId, $wrapper->wikiId
);
35 * @dataProvider provideWikiIds
37 public function testNewSqlBlobStore( $wikiId ) {
38 $factory = MediaWikiServices
::getInstance()->getBlobStoreFactory();
39 $store = $factory->newSqlBlobStore( $wikiId );
40 $this->assertInstanceOf( SqlBlobStore
::class, $store );
42 $wrapper = TestingAccessWrapper
::newFromObject( $store );
43 $this->assertEquals( $wikiId, $wrapper->wikiId
);