Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5968051
TextContentsMatcher.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
919 B
Referenced Files
None
Subscribers
None
TextContentsMatcher.php
View Options
<?php
namespace
WMDE\HamcrestHtml
;
use
Hamcrest\Description
;
use
Hamcrest\Matcher
;
use
Hamcrest\Util
;
class
TextContentsMatcher
extends
TagMatcher
{
/**
* @var Matcher
*/
private
$matcher
;
/**
* @param Matcher|string $text
*
* @return self
*/
public
static
function
havingTextContents
(
$text
)
{
return
new
static
(
Util
::
wrapValueWithIsEqual
(
$text
)
);
}
public
function
__construct
(
Matcher
$matcher
)
{
parent
::
__construct
();
$this
->
matcher
=
$matcher
;
}
public
function
describeTo
(
Description
$description
)
{
$description
->
appendText
(
'having text contents '
)->
appendDescriptionOf
(
$this
->
matcher
);
}
/**
* @param \DOMElement $item
* @param Description $mismatchDescription
*
* @return bool
*/
protected
function
matchesSafelyWithDiagnosticDescription
(
$item
,
Description
$mismatchDescription
)
{
return
$this
->
matcher
->
matches
(
$item
->
textContent
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 12:48 (2 d, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0b/91/e9f238bfaf9368c765f2df8f063d
Default Alt Text
TextContentsMatcher.php (919 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment