Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5968000
TagNameMatcher.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
TagNameMatcher.php
View Options
<?php
namespace
WMDE\HamcrestHtml
;
use
DOMElement
;
use
Hamcrest\Description
;
use
Hamcrest\Matcher
;
use
Hamcrest\Util
;
class
TagNameMatcher
extends
TagMatcher
{
/**
* @var Matcher
*/
private
$tagNameMatcher
;
/**
* @param Matcher|string $tagName
*
* @return self
*/
public
static
function
withTagName
(
$tagName
)
{
return
new
static
(
Util
::
wrapValueWithIsEqual
(
$tagName
)
);
}
public
function
__construct
(
Matcher
$tagNameMatcher
)
{
parent
::
__construct
();
$this
->
tagNameMatcher
=
$tagNameMatcher
;
}
public
function
describeTo
(
Description
$description
)
{
$description
->
appendText
(
'with tag name '
)
->
appendDescriptionOf
(
$this
->
tagNameMatcher
);
}
/**
* @param DOMElement $item
* @param Description $mismatchDescription
*
* @return bool
*/
protected
function
matchesSafelyWithDiagnosticDescription
(
$item
,
Description
$mismatchDescription
)
{
if
(
$this
->
tagNameMatcher
->
matches
(
$item
->
tagName
)
)
{
return
true
;
}
$mismatchDescription
->
appendText
(
'tag name '
);
$this
->
tagNameMatcher
->
describeMismatch
(
$item
->
tagName
,
$mismatchDescription
);
return
false
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 12:46 (2 d, 18 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
51/6d/31574891ba41928f295ef4dde068
Default Alt Text
TagNameMatcher.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment