X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Ffilerepo%2Ffile%2FLocalFileTest.php;h=8f378052a33fe6dbca3a021b3a5d0ed618c6284a;hb=bdc6b4e378c6872a20f6fb5842f1a49961af91b4;hp=e25e6064dbd13e10dd711480ea64f9f1fea6fc47;hpb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php index e25e6064db..8f378052a3 100644 --- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php +++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php @@ -7,6 +7,19 @@ class LocalFileTest extends MediaWikiTestCase { + /** @var LocalRepo */ + private $repo_hl0; + /** @var LocalRepo */ + private $repo_hl2; + /** @var LocalRepo */ + private $repo_lc; + /** @var File */ + private $file_hl0; + /** @var File */ + private $file_hl2; + /** @var File */ + private $file_lc; + protected function setUp() { parent::setUp(); @@ -180,4 +193,26 @@ class LocalFileTest extends MediaWikiTestCase { 'wfLocalFile() returns LocalFile for valid Titles' ); } + + /** + * @covers File::getUser + */ + public function testGetUserForNonExistingFile() { + $this->assertSame( 'Unknown user', $this->file_hl0->getUser() ); + $this->assertSame( 0, $this->file_hl0->getUser( 'id' ) ); + } + + /** + * @covers File::getUser + */ + public function testDescriptionShortUrlForNonExistingFile() { + $this->assertNull( $this->file_hl0->getDescriptionShortUrl() ); + } + + /** + * @covers File::getUser + */ + public function testDescriptionTextForNonExistingFile() { + $this->assertFalse( $this->file_hl0->getDescriptionText() ); + } }