1 | <?php |
||
14 | class KeysMatcher extends AbstractMatcher |
||
15 | { |
||
16 | /** |
||
17 | * The verb used in the template. Uses "have" if the 'contain' flag is not used, otherwise |
||
18 | * "contain" is used. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $verb = 'have'; |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | * |
||
27 | * @return TemplateInterface |
||
28 | */ |
||
29 | public function getDefaultTemplate() |
||
44 | |||
45 | /** |
||
46 | * Assert that the actual value is an array or object with the expected keys. |
||
47 | * |
||
48 | * @param $actual |
||
49 | * @return mixed |
||
50 | */ |
||
51 | protected function doMatch($actual) |
||
63 | |||
64 | /** |
||
65 | * Normalize the actual value into an array, whether it is an object |
||
66 | * or an array. |
||
67 | * |
||
68 | * @param object|array $actual |
||
69 | */ |
||
70 | protected function getArrayValue($actual) |
||
82 | |||
83 | /** |
||
84 | * Returns a formatted string of expected keys. |
||
85 | * |
||
86 | * @return string keys |
||
87 | */ |
||
88 | protected function getKeyString() |
||
102 | |||
103 | /** |
||
104 | * Used when the 'contain' flag exists on the Assertion. Checks |
||
105 | * if the expected keys are included in the object or array. |
||
106 | * |
||
107 | * @param array $actual |
||
108 | * @return true |
||
109 | */ |
||
110 | protected function matchInclusion($actual) |
||
120 | } |
||
121 |