MediaWiki REL1_31
BlobStoreFactoryTest.php
Go to the documentation of this file.
1<?php
2
4
9use Wikimedia\TestingAccessWrapper;
10
15
16 public function provideWikiIds() {
17 yield [ false ];
18 yield [ 'someWiki' ];
19 }
20
24 public function testNewBlobStore( $wikiId ) {
25 $factory = MediaWikiServices::getInstance()->getBlobStoreFactory();
26 $store = $factory->newBlobStore( $wikiId );
27 $this->assertInstanceOf( BlobStore::class, $store );
28
29 // This only works as we currently know this is a SqlBlobStore object
30 $wrapper = TestingAccessWrapper::newFromObject( $store );
31 $this->assertEquals( $wikiId, $wrapper->wikiId );
32 }
33
37 public function testNewSqlBlobStore( $wikiId ) {
38 $factory = MediaWikiServices::getInstance()->getBlobStoreFactory();
39 $store = $factory->newSqlBlobStore( $wikiId );
40 $this->assertInstanceOf( SqlBlobStore::class, $store );
41
42 $wrapper = TestingAccessWrapper::newFromObject( $store );
43 $this->assertEquals( $wikiId, $wrapper->wikiId );
44 }
45
46}
MediaWikiServices is the service locator for the application scope of MediaWiki.
static getInstance()
Returns the global default instance of the top level service locator.
Service for storing and loading Content objects.
processing should stop and the error should be shown to the user * false
Definition hooks.txt:187
Service for loading and storing data blobs.
Definition BlobStore.php:33