Example #1
0
 /**
  * @param mixed $element
  * @return boolean
  */
 public function contains($element)
 {
     if (!$element instanceof Comparable) {
         return parent::contains($element);
     }
     foreach ($this->elements as $el) {
         if ($this->comparator->equals($el, $element)) {
             return true;
         }
     }
     return false;
 }
 public function testNotContainsElement()
 {
     $element = 'foo';
     $collection = new BasicCollection();
     self::assertFalse($collection->contains($element));
 }