Example #1
0
 /**
  * @param mixed $value
  *
  * @return $this
  */
 public function add($value)
 {
     if (!$value instanceof NodeInterface) {
         throw new InvalidArgumentException("The specified value does not implement NodeInterface");
     }
     return parent::add($value);
 }
Example #2
0
 public function testAddDuplicate()
 {
     $coll = new Collection(['foo', 'bar', 'baz']);
     $result = $coll->add('baz');
     $this->assertEquals(['foo', 'bar', 'baz', 'baz'], $coll->getAll());
     $this->assertSame($coll, $result);
 }
 /**
  * @param mixed $value
  */
 protected function addItem($value)
 {
     parent::add($value);
 }