wiki.techinc.nl/tests/phpunit/includes/Storage/BlobStoreFactoryTest.php
addshore 959bc315f2 MediaWikiTestCase to MediaWikiIntegrationTestCase
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)

My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.

Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
2020-06-30 17:02:22 +01:00

46 lines
1.3 KiB
PHP

<?php
namespace MediaWiki\Tests\Storage;
use MediaWiki\MediaWikiServices;
use MediaWiki\Storage\BlobStore;
use MediaWiki\Storage\SqlBlobStore;
use MediaWikiIntegrationTestCase;
use Wikimedia\TestingAccessWrapper;
/**
* @covers \MediaWiki\Storage\BlobStoreFactory
*/
class BlobStoreFactoryTest extends MediaWikiIntegrationTestCase {
public function provideDbDomains() {
yield [ false ];
yield [ 'someWiki' ];
}
/**
* @dataProvider provideDbDomains
*/
public function testNewBlobStore( $dbDomain ) {
$factory = MediaWikiServices::getInstance()->getBlobStoreFactory();
$store = $factory->newBlobStore( $dbDomain );
$this->assertInstanceOf( BlobStore::class, $store );
// This only works as we currently know this is a SqlBlobStore object
$wrapper = TestingAccessWrapper::newFromObject( $store );
$this->assertEquals( $dbDomain, $wrapper->dbDomain );
}
/**
* @dataProvider provideDbDomains
*/
public function testNewSqlBlobStore( $dbDomain ) {
$factory = MediaWikiServices::getInstance()->getBlobStoreFactory();
$store = $factory->newSqlBlobStore( $dbDomain );
$this->assertInstanceOf( SqlBlobStore::class, $store );
$wrapper = TestingAccessWrapper::newFromObject( $store );
$this->assertEquals( $dbDomain, $wrapper->dbDomain );
}
}