예제 #1
0
 public function testAddAll()
 {
     $this->seq->addAll(array(2, 1, 3));
     $this->assertSame(array(0, $this->a, $this->b, 0, 2, 1, 3), $this->seq->all());
     $this->seq->sortWith(function ($a, $b) {
         if (is_integer($a)) {
             if (!is_integer($b)) {
                 return -1;
             }
             return $a > $b ? 1 : -1;
         }
         if (is_integer($b)) {
             return 1;
         }
         return -1;
     });
     $this->assertSame(array(0, 0, 1, 2, 3, $this->a, $this->b), $this->seq->all());
 }
예제 #2
0
 /**
  * @param Checker $checker
  */
 public function addChecker(Checker $checker)
 {
     $this->checkers->add($checker);
     $this->checkers->sortWith($this->checkersSorter());
 }