コード例 #1
0
ファイル: HashSetTest.php プロジェクト: robo47/BlazeFramework
 public function testRemove()
 {
     // Remove the following lines when you implement this test.
     $this->assertFalse($this->object->remove(89));
     $this->assertTrue($this->object->remove(5));
     $this->assertFalse($this->object->contains(5));
 }
コード例 #2
0
 function testAddInvalidElement()
 {
     $set = new HashSet("string");
     $this->expectException("IllegalArgumentException");
     $set->add(1223);
     $this->assertFalse($set->contains("Hello there"));
 }
コード例 #3
0
 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));
 }
コード例 #4
0
 public function hashSetAddElement()
 {
     $s = new HashSet();
     $s[] = new String('X');
     $this->assertTrue($s->contains(new String('X')));
 }