示例#1
0
 function test__constructException()
 {
     $this->setExpectedException('\\Collections\\StateException');
     $tree = new SplayTree();
     $tree->add(1);
     new SortedSet(null, $tree);
 }
示例#2
0
 /**
  * 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));
 }
示例#3
0
 /**
  * @expectedException \Collections\StateException
  */
 function testSetCompareNotEmpty()
 {
     $tree = new SplayTree();
     $tree->add(0);
     $tree->setCompare(function ($a, $b) {
     });
 }