Пример #1
0
 function test__constructException()
 {
     $this->setExpectedException('\\Collections\\StateException');
     $tree = new AvlTree();
     $tree->add(1);
     new SortedSet(null, $tree);
 }
Пример #2
0
 function test__clone()
 {
     $avl = new AvlTree();
     $avl->add(1);
     $avl->add(0);
     $avl->add(2);
     $copy = clone $avl;
     $this->assertCount(3, $copy);
     $avl->add(3);
     $this->assertCount(3, $copy);
     $this->assertCount(4, $avl);
 }