Example #1
0
 public function testIsEmpty()
 {
     // Remove the following lines when you implement this test.
     $this->assertFalse($this->object->isEmpty());
     $this->object->clear();
     $this->assertTrue($this->object->isEmpty());
 }
Example #2
0
 /**
  * This method tests the add and the get method
  * of the HashMap.
  *
  * @return void
  */
 public function testAddAndGetAndIsEmptyAndClear()
 {
     // initialize a new HashMap
     $map = new HashMap();
     // check that the HashMap is empty
     $this->assertTrue($map->isEmpty());
     // add a new element
     $map->add(10, "Test");
     // get the element
     $this->assertEquals("Test", $map->get(10));
     // check that the HashMap is not empty
     $this->assertFalse($map->isEmpty());
     // remove all elements
     $map->clear();
     // check that the HashMap is empty
     $this->assertTrue($map->isEmpty());
 }
Example #3
0
 /**
  * マッピングの個数が 0 になることを確認します.
  * 
  * @covers Peach\Util\HashMap::clear
  */
 public function testClear()
 {
     $this->object->clear();
     $this->assertSame(0, $this->object->size());
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     $this->store->clear();
 }