Class KeysMatcher
KeysMatcher determines if the actual array or object has the expected keys. If the Assertion has a 'contain' flag set, it will check if the expected keys are included in the object or array.
- Peridot\Leo\Matcher\AbstractMatcher implements Peridot\Leo\Matcher\MatcherInterface
- Extended by Peridot\Leo\Matcher\KeysMatcher
public
Peridot\Leo\Matcher\Template\TemplateInterface
getDefaultTemplate( )
Return a default TemplateInterface if none was set.
Return a default TemplateInterface if none was set.
Returns
protected
mixed
protected
getArrayValue( object|array $actual )
Normalize the actual value into an array, whether it is an object or an array.
Normalize the actual value into an array, whether it is an object or an array.
Parameters
- $actual
protected
string
getKeyString( )
Returns a formatted string of expected keys.
Returns a formatted string of expected keys.
Returns
string
keys
protected
true
matchInclusion( array $actual )
Used when the 'contain' flag exists on the Assertion. Checks if the expected keys are included in the object or array.
Used when the 'contain' flag exists on the Assertion. Checks if the expected keys are included in the object or array.
Parameters
- $actual
Returns
true
protected
string
$verb
The verb used in the template. Uses "have" if the 'contain' flag is not used, otherwise "contain" is used.
The verb used in the template. Uses "have" if the 'contain' flag is not used, otherwise "contain" is used.
'have'