| @@ 74-83 (lines=10) @@ | ||
| 71 | * |
|
| 72 | * @return $this |
|
| 73 | */ |
|
| 74 | public function isEmpty($failMessage = null) |
|
| 75 | { |
|
| 76 | if (($actual = $this->valueAsCollection()->isEmpty()) === true) { |
|
| 77 | $this->pass(); |
|
| 78 | } else { |
|
| 79 | $this->fail($failMessage ?: $this->getLocale()->_('%s is not empty', $this, $actual)); |
|
| 80 | } |
|
| 81 | ||
| 82 | return $this; |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @param string $failMessage |
|
| @@ 51-61 (lines=11) @@ | ||
| 48 | * |
|
| 49 | * @return $this |
|
| 50 | */ |
|
| 51 | public function containsKey($key) |
|
| 52 | { |
|
| 53 | $collection = $this->valueAsCollection(); |
|
| 54 | if ($collection->containsKey($key) === true) { |
|
| 55 | $this->pass(); |
|
| 56 | } else { |
|
| 57 | $this->fail($this->getLocale()->_('The hashmap not contain the key %s', $key)); |
|
| 58 | } |
|
| 59 | ||
| 60 | return $this; |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @param array|\Traversable $keys |
|
| @@ 82-92 (lines=11) @@ | ||
| 79 | * |
|
| 80 | * @return $this |
|
| 81 | */ |
|
| 82 | public function notContainsKey($key) |
|
| 83 | { |
|
| 84 | $collection = $this->valueAsCollection(); |
|
| 85 | if ($collection->containsKey($key) === true) { |
|
| 86 | $this->fail($this->getLocale()->_('The hashmap contain this key %s', $key)); |
|
| 87 | } else { |
|
| 88 | $this->pass(); |
|
| 89 | } |
|
| 90 | ||
| 91 | return $this; |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * @throws LogicException |
|