Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2753101
FileRepoTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
FileRepoTest.php
View Options
<?php
use
MediaWiki\MainConfigNames
;
use
Wikimedia\FileBackend\FSFileBackend
;
/**
* @covers \FileRepo
*/
class
FileRepoTest
extends
MediaWikiIntegrationTestCase
{
public
function
testFileRepoConstructionOptionCanNotBeNull
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
new
FileRepo
();
}
public
function
testFileRepoConstructionOptionCanNotBeAnEmptyArray
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
new
FileRepo
(
[]
);
}
public
function
testFileRepoConstructionOptionNeedNameKey
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
new
FileRepo
(
[
'backend'
=>
'foobar'
]
);
}
public
function
testFileRepoConstructionOptionNeedBackendKey
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
new
FileRepo
(
[
'name'
=>
'foobar'
]
);
}
public
function
testFileRepoConstructionWithRequiredOptions
()
{
$f
=
new
FileRepo
(
[
'name'
=>
'FileRepoTestRepository'
,
'backend'
=>
new
FSFileBackend
(
[
'name'
=>
'local-testing'
,
'wikiId'
=>
'test_wiki'
,
'containerPaths'
=>
[]
]
)
]
);
$this
->
assertInstanceOf
(
FileRepo
::
class
,
$f
);
}
public
function
testFileRepoConstructionWithInvalidCasing
()
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
$this
->
expectExceptionMessage
(
'File repos with initial capital false'
);
$this
->
overrideConfigValue
(
MainConfigNames
::
CapitalLinks
,
true
);
new
FileRepo
(
[
'name'
=>
'foobar'
,
'backend'
=>
'local-backend'
,
'initialCapital'
=>
false
,
]
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 20:48 (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/7a/5d219a21a5fde42afae12d987106
Default Alt Text
FileRepoTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment