Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7405728
RefTagHandlerTest.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
RefTagHandlerTest.php
View Options
<?php
namespace
Cite\Tests\Unit
;
use
Cite\Parsoid\RefTagHandler
;
use
MediaWiki\Config\HashConfig
;
use
MediaWikiUnitTestCase
;
use
Wikimedia\Parsoid\Ext\ParsoidExtensionAPI
;
use
Wikimedia\Parsoid\NodeData\DataMw
;
use
Wikimedia\Parsoid\NodeData\DataMwBody
;
use
Wikimedia\Parsoid\Utils\DOMDataUtils
;
use
Wikimedia\Parsoid\Utils\DOMUtils
;
/**
* @covers \Cite\Parsoid\RefTagHandler
* @license GPL-2.0-or-later
*/
class
RefTagHandlerTest
extends
MediaWikiUnitTestCase
{
public
function
testProcessAttributeEmbeddedHTML
()
{
$doc
=
DOMUtils
::
parseHTML
(
''
);
DOMDataUtils
::
prepareDoc
(
$doc
);
$elt
=
$doc
->
createElement
(
'a'
);
DOMDataUtils
::
setDataMw
(
$elt
,
new
DataMw
(
[
'body'
=>
DataMwBody
::
new
(
[
'html'
=>
'old'
]
),
]
)
);
$group
=
new
RefTagHandler
(
new
HashConfig
(
[
'CiteSubReferencing'
=>
false
]
)
);
$group
->
processAttributeEmbeddedHTML
(
$this
->
createNoOpMock
(
ParsoidExtensionAPI
::
class
),
$elt
,
static
fn
()
=>
'new'
);
$this
->
assertSame
(
'new'
,
DOMDataUtils
::
getDataMw
(
$elt
)->
body
->
html
);
}
// TODO: Incomplete, there are a few more public methods to test
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 20:02 (1 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e3/8c/b82a8734885cf114563eac21f908
Default Alt Text
RefTagHandlerTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment