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()); }
/** * 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()); }
/** * マッピングの個数が 0 になることを確認します. * * @covers Peach\Util\HashMap::clear */ public function testClear() { $this->object->clear(); $this->assertSame(0, $this->object->size()); }
/** * {@inheritdoc} */ public function clear() { $this->store->clear(); }