function test__constructException() { $this->setExpectedException('\\Collections\\StateException'); $tree = new SplayTree(); $tree->add(1); new SortedSet(null, $tree); }
/** * Note that if the key is considered equal to an already existing key in * the map that it's value will be replaced with the new one. * * @param $key * @param mixed $value * * @return void * @throws TypeException when the $key or value is not the correct type. */ function set($key, $value) { $this->avl->add(new Pair($key, $value)); }
/** * @expectedException \Collections\StateException */ function testSetCompareNotEmpty() { $tree = new SplayTree(); $tree->add(0); $tree->setCompare(function ($a, $b) { }); }