$user = $this->mRecord->getUser( $audience, $user );
return $user ? $user->getName() : '';
}
+
/**
* Fetch revision comment if it's available to the specified audience.
* If the specified audience does not have access to the comment, an
// Allocated file for testing
$this->tempFileName = tempnam( wfTempDir(), 'WEBP' );
}
+
public function tearDown() {
parent::tearDown();
unlink( $this->tempFileName );
}
+
/**
* @dataProvider provideTestExtractMetaData
*/
$this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $this->tempFileName ) );
}
+
public function provideTestExtractMetaData() {
// phpcs:disable Generic.Files.LineLength
return [
public function testWithFileExtractMetaData( $filename, $expectedResult ) {
$this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $filename ) );
}
+
public function provideTestWithFileExtractMetaData() {
return [
[ __DIR__ . '/../../data/media/2_webp_ll.webp',
$handler = new WebPHandler();
$this->assertEquals( $expectedResult, $handler->getImageSize( null, $path ) );
}
+
public function provideTestGetImageSize() {
return [
// Public domain files from https://developers.google.com/speed/webp/gallery2
$mime = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$this->assertEquals( 'image/webp', $mime->guessMimeType( $path, false ) );
}
+
public function provideTestGetMimeType() {
return [
// Public domain files from https://developers.google.com/speed/webp/gallery2