| @@ 250-260 (lines=11) @@ | ||
| 247 | * |
|
| 248 | * @return mixed |
|
| 249 | */ |
|
| 250 | public function contains($value) |
|
| 251 | { |
|
| 252 | $collection = $this->valueAsCollection(); |
|
| 253 | if ($collection->findOne(Criteria::eq($value)) !== null) { |
|
| 254 | $this->pass(); |
|
| 255 | } else { |
|
| 256 | $this->fail($this->getLocale()->_('The collection not contain the value %s', $value)); |
|
| 257 | } |
|
| 258 | ||
| 259 | return $this; |
|
| 260 | } |
|
| 261 | ||
| 262 | /** |
|
| 263 | * @param array|\Traversable $values |
|
| @@ 281-291 (lines=11) @@ | ||
| 278 | * |
|
| 279 | * @return mixed |
|
| 280 | */ |
|
| 281 | public function notContains($value) |
|
| 282 | { |
|
| 283 | $collection = $this->valueAsCollection(); |
|
| 284 | if ($collection->findOne(Criteria::eq($value)) !== null) { |
|
| 285 | $this->fail($this->getLocale()->_('The collection contain an element with this value %s', $value)); |
|
| 286 | } else { |
|
| 287 | $this->pass(); |
|
| 288 | } |
|
| 289 | ||
| 290 | return $this; |
|
| 291 | } |
|
| 292 | ||
| 293 | /** |
|
| 294 | * {@inheritdoc} |
|