+ /** @covers MessageBlobStore::setLogger */
+ public function testSetLogger() {
+ $blobStore = $this->makeBlobStore();
+ $this->assertSame( null, $blobStore->setLogger( new Psr\Log\NullLogger() ) );
+ }
+
+ /** @covers MessageBlobStore::getResourceLoader */
+ public function testGetResourceLoader() {
+ // Call protected method
+ $blobStore = TestingAccessWrapper::newFromObject( $this->makeBlobStore() );
+ $this->assertInstanceOf(
+ ResourceLoader::class,
+ $blobStore->getResourceLoader()
+ );
+ }
+
+ /** @covers MessageBlobStore::fetchMessage */
+ public function testFetchMessage() {
+ $module = $this->makeModule( [ 'mainpage' ] );
+ $rl = new ResourceLoader();
+ $rl->register( $module->getName(), $module );
+
+ $blobStore = $this->makeBlobStore( null, $rl );
+ $blob = $blobStore->getBlob( $module, 'en' );
+
+ $this->assertEquals( '{"mainpage":"Main Page"}', $blob, 'Generated blob' );
+ }
+
+ /** @covers MessageBlobStore::fetchMessage */
+ public function testFetchMessageFail() {
+ $module = $this->makeModule( [ 'i-dont-exist' ] );
+ $rl = new ResourceLoader();
+ $rl->register( $module->getName(), $module );
+
+ $blobStore = $this->makeBlobStore( null, $rl );
+ $blob = $blobStore->getBlob( $module, 'en' );
+
+ $this->assertEquals( '{"i-dont-exist":"\u29fci-dont-exist\u29fd"}', $blob, 'Generated blob' );
+ }
+