Beispiel #1
0
 public function testAddAll()
 {
     // Remove the following lines when you implement this test.
     $col = new HashSet();
     $col->add(1);
     $col->add(5);
     $col->add(6);
     $col->add(2);
     $this->assertFalse($this->object->addAll($col));
     $col->add(788);
     $this->assertTrue($this->object->addAll($col));
 }
 /**
  * Retrieve a set of classes used in this interface
  *
  * @return  remote.ClassReference[]
  */
 public function classSet()
 {
     $set = new HashSet();
     for ($i = 0; $i < $this->methods->length; $i++) {
         $set->addAll($this->methods[$i]->classSet());
     }
     return $set->toArray();
 }
 public function classImplementsComparatorInterface()
 {
     $class = $this->classloader->loadClass($this->classname);
     $interface = XPClass::forName('util.Comparator');
     $interfaces = new HashSet();
     $interfaces->addAll($class->getInterfaces());
     $this->assertTrue($interfaces->contains($interface));
 }
 public function hashSetUsableInForeach()
 {
     $s = new HashSet();
     $s->addAll(array(new String('0'), new String('1'), new String('2')));
     foreach ($s as $i => $element) {
         $this->assertEquals(new String($i), $element);
     }
 }