Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7420110
SkinComponentFooterTest.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
SkinComponentFooterTest.php
View Options
<?php
use
MediaWiki\Config\HashConfig
;
use
MediaWiki\Skin\SkinComponentFooter
;
use
MediaWiki\Skin\SkinComponentRegistryContext
;
/**
* @covers \MediaWiki\Skin\SkinComponentFooter
* @group Skin
*/
class
SkinComponentFooterTest
extends
MediaWikiUnitTestCase
{
public
static
function
provideMakeFooterIconHTML
()
{
$config
=
new
HashConfig
(
[]
);
return
[
[
$config
,
'<img src="foo.gif">'
,
'withImage'
,
'<img src="foo.gif">'
],
[
$config
,
[
'src'
=>
'foo.jpg'
,
],
'withImage'
,
'<img src="foo.jpg" loading="lazy">'
],
[
$config
,
[
'src'
=>
'foo.jpg'
,
'sources'
=>
[
[
'media'
=>
'(min-width: 500px)'
,
'srcset'
=>
'fooXL.jpg'
,
],
]
],
'withImage'
,
[
'<img src="foo.jpg" loading="lazy">'
,
'<picture'
,
'<source media="(min-width: 500px)" srcset="fooXL.jpg'
,
],
],
[
$config
,
[
'src'
=>
'foo.jpg'
,
'alt'
=>
'alt text'
],
false
,
'alt text'
,
]
];
}
/**
* @dataProvider provideMakeFooterIconHTML
*
*/
public
function
testMakeFooterIconHTML
(
$config
,
$icon
,
$withImage
,
$result
)
{
$ctx
=
$this
->
createMock
(
SkinComponentRegistryContext
::
class
);
$footer
=
new
SkinComponentFooter
(
$ctx
);
$html
=
$footer
::
makeFooterIconHTML
(
$config
,
$icon
,
$withImage
);
if
(
is_array
(
$result
)
)
{
foreach
(
$result
as
$str
)
{
$this
->
assertStringContainsString
(
$str
,
$html
);
}
}
else
{
$this
->
assertStringContainsString
(
$result
,
$html
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 04:50 (1 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
56/17/b04c5859982ded6dba5747b2a759
Default Alt Text
SkinComponentFooterTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment