Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4106950
ContributeFactoryTest.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
ContributeFactoryTest.php
View Options
<?php
use
MediaWiki\Context\RequestContext
;
use
MediaWiki\HookContainer\HookRunner
;
use
MediaWiki\SpecialPage\SpecialPage
;
use
MediaWiki\Specials\Contribute\Card\ContributeCard
;
use
MediaWiki\Specials\Contribute\Card\ContributeCardActionLink
;
use
MediaWiki\Specials\Contribute\ContributeFactory
;
/**
* @author MAbualruz
* @group Database
* @covers \MediaWiki\Specials\Contribute\ContributeFactory
*/
class
ContributeFactoryTest
extends
MediaWikiIntegrationTestCase
{
/**
* @covers \MediaWiki\Specials\Contribute\ContributeFactory::getCards
*/
public
function
testGetCards
()
{
$context
=
RequestContext
::
getMain
();
$services
=
$this
->
getServiceContainer
();
$hookContainer
=
$services
->
getHookContainer
();
$factory
=
new
ContributeFactory
(
$context
,
new
HookRunner
(
$hookContainer
)
);
$cards
=
$factory
->
getCards
();
$this
->
assertIsArray
(
$cards
);
$this
->
assertNotEmpty
(
$cards
);
$defaltCard
=
$cards
[
count
(
$cards
)
-
1
];
$expectedCard
=
(
new
ContributeCard
(
$context
->
msg
(
'newpage'
)->
text
(),
$context
->
msg
(
'newpage-desc'
)->
text
(),
'article'
,
new
ContributeCardActionLink
(
SpecialPage
::
getSafeTitleFor
(
'Wantedpages'
)->
getLocalURL
(),
$context
->
msg
(
'view-missing-pages'
)->
text
()
)
)
)->
toArray
();
$this
->
assertArrayEquals
(
[
'title'
,
'icon'
,
'description'
,
'action'
],
array_keys
(
$defaltCard
)
);
$this
->
assertArrayEquals
(
$expectedCard
,
$defaltCard
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 19:49 (2 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
86/43/e716188171c285b3e0643ed48bdb
Default Alt Text
ContributeFactoryTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment