Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4141542
LinkBatchFactoryTest.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
LinkBatchFactoryTest.php
View Options
<?php
use
MediaWiki\Cache\GenderCache
;
use
MediaWiki\Cache\LinkBatch
;
use
MediaWiki\Cache\LinkBatchFactory
;
use
MediaWiki\Cache\LinkCache
;
use
MediaWiki\Language\Language
;
use
MediaWiki\Linker\LinksMigration
;
use
MediaWiki\Logger\LoggerFactory
;
use
MediaWiki\Page\PageReference
;
use
MediaWiki\Page\PageReferenceValue
;
use
MediaWiki\Title\TitleFormatter
;
use
MediaWiki\Title\TitleValue
;
use
Wikimedia\Rdbms\IConnectionProvider
;
/**
* @group Cache
* @covers \MediaWiki\Cache\LinkBatchFactory
*/
class
LinkBatchFactoryTest
extends
MediaWikiUnitTestCase
{
use
FactoryArgTestTrait
;
protected
static
function
getFactoryClass
()
{
return
LinkBatchFactory
::
class
;
}
protected
static
function
getInstanceClass
()
{
return
LinkBatch
::
class
;
}
protected
static
function
getExtraClassArgCount
()
{
// $arr
return
1
;
}
protected
function
getOverriddenMockValueForParam
(
ReflectionParameter
$param
)
{
if
(
$param
->
getName
()
===
'initialItems'
)
{
return
[
[]
];
}
return
[];
}
public
function
testNewLinkBatch
()
{
$factory
=
new
LinkBatchFactory
(
$this
->
createMock
(
LinkCache
::
class
),
$this
->
createMock
(
TitleFormatter
::
class
),
$this
->
createMock
(
Language
::
class
),
$this
->
createMock
(
GenderCache
::
class
),
$this
->
createMock
(
IConnectionProvider
::
class
),
$this
->
createMock
(
LinksMigration
::
class
),
LoggerFactory
::
getInstance
(
'LinkBatch'
)
);
$linkBatch
=
$factory
->
newLinkBatch
(
[
new
TitleValue
(
NS_MAIN
,
'Foo'
),
new
PageReferenceValue
(
NS_TALK
,
'Bar'
,
PageReference
::
LOCAL
),
]
);
$this
->
assertFalse
(
$linkBatch
->
isEmpty
()
);
$this
->
assertSame
(
2
,
$linkBatch
->
getSize
()
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 15:59 (3 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
36/24/36c5f928af0234ecab265132b589
Default Alt Text
LinkBatchFactoryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment