function test_getIterator_notEmpty_returnsIterator() { $set = new SortedSet(); $set->add(0); $iterator = $set->getIterator(); $this->assertInstanceOf(__NAMESPACE__ . '\\SortedSetIterator', $iterator); }
/** * @dataProvider getElementsToRemove */ public function testRemoveItemsOnDensitySetDecrementKeyScore($times, $expectedScore) { for ($i = 0; $i < 15; $i++) { $this->set->add('key'); } for ($i = 0; $i < $times; $i++) { $this->set->rem('key'); } $this->assertEquals($this->set->rank('key'), $expectedScore); }
public function testOptimalNumberOfHashesCalculation() { $this->assertEquals($this->set->getOptimalNumberOfHashes(1000000), 1); }