Overview

Namespaces

  • None
  • Peridot
    • Leo
      • Formatter
      • Interfaces
        • Assert
      • Matcher
        • Template
      • ObjectPath
      • Responder
  • PHP

Classes

  • AbstractMatcher
  • CountableMatcher
  • EmptyMatcher
  • EqualMatcher
  • ExceptionMatcher
  • GreaterThanMatcher
  • GreaterThanOrEqualMatcher
  • InclusionMatcher
  • InstanceofMatcher
  • KeysMatcher
  • LengthMatcher
  • LessThanMatcher
  • LessThanOrEqualMatcher
  • Match
  • NullMatcher
  • PatternMatcher
  • PredicateMatcher
  • PropertyMatcher
  • RangeMatcher
  • SameMatcher
  • SubStringMatcher
  • TrueMatcher
  • TruthyMatcher
  • TypeMatcher

Interfaces

  • MatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree

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
Namespace: Peridot\Leo\Matcher
Package: Peridot\Leo\Matcher
Located at Matcher/KeysMatcher.php
Methods summary
public Peridot\Leo\Matcher\Template\TemplateInterface
# getDefaultTemplate( )

Return a default TemplateInterface if none was set.

Return a default TemplateInterface if none was set.

Returns

Peridot\Leo\Matcher\Template\TemplateInterface
protected mixed
# doMatch( mixed $actual )

Assert that the actual value is an array or object with the expected keys.

Assert that the actual value is an array or object with the expected keys.

Parameters

$actual

Returns

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
Methods inherited from Peridot\Leo\Matcher\AbstractMatcher
__construct(), getTemplate(), invert(), isNegated(), match(), setAssertion(), setTemplate()
Properties summary
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'
Properties inherited from Peridot\Leo\Matcher\AbstractMatcher
$assertion, $expected, $negated, $template
Leo API documentation generated by ApiGen