Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7429410
ReferencesTest.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
ReferencesTest.php
View Options
<?php
namespace
Cite\Tests\Unit
;
use
Cite\Parsoid\References
;
use
MediaWiki\Config\Config
;
use
MediaWikiUnitTestCase
;
use
Wikimedia\Parsoid\Ext\ParsoidExtensionAPI
;
use
Wikimedia\Parsoid\NodeData\DataMw
;
use
Wikimedia\Parsoid\Utils\DOMDataUtils
;
use
Wikimedia\Parsoid\Utils\DOMUtils
;
/**
* @covers \Cite\Parsoid\References
* @license GPL-2.0-or-later
*/
class
ReferencesTest
extends
MediaWikiUnitTestCase
{
public
function
testProcessAttributeEmbeddedHTML
()
{
$doc
=
DOMUtils
::
parseHTML
(
''
);
DOMDataUtils
::
prepareDoc
(
$doc
);
$elt
=
$doc
->
createElement
(
'a'
);
DOMDataUtils
::
setDataMw
(
$elt
,
new
DataMw
(
[
'body'
=>
(
object
)[
'html'
=>
'old'
]
]
)
);
$refs
=
new
References
(
$this
->
createNoOpMock
(
Config
::
class
)
);
$refs
->
processAttributeEmbeddedHTML
(
$this
->
createNoOpMock
(
ParsoidExtensionAPI
::
class
),
$elt
,
fn
()
=>
'new'
);
$this
->
assertSame
(
'new'
,
DOMDataUtils
::
getDataMw
(
$elt
)->
body
->
html
);
}
// TODO: Incomplete, there are many more static and non-static methods to test
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 09:58 (10 h, 34 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
58/fc/f3c851aec1d1da8d8257214f2eab
Default Alt Text
ReferencesTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment