add() 공개 메소드

Attempts to add the value to the set, will fail if the value is already contained in the set.
public add ( mixed $value ) : boolean
$value mixed
리턴 boolean Whether the value was successfully added
예제 #1
0
파일: SetTest.php 프로젝트: timetoogo/pinq
 /**
  * @dataProvider sets
  */
 public function testThatSetCanRemoveAddedElements(ISet $set)
 {
     $set->add(0);
     $set->add(1);
     $this->assertCount(2, $set);
     $set->remove('0');
     $this->assertCount(2, $set);
     $set->remove(0);
     $this->assertCount(1, $set);
     $set->remove(1);
     $this->assertCount(0, $set);
 }