Annotation of embedaddon/php/ext/spl/tests/spl_heap_is_empty_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: SplHeap, test trivial method to find if a heap is empty
! 3: --CREDITS--
! 4: Nathaniel McHugh nat@fishtrap.co.uk
! 5: #testfest London 2009-05-09
! 6: --FILE--
! 7: <?php
! 8:
! 9: class MyHeap extends SplHeap{
! 10:
! 11: public function compare($a, $b){
! 12: return $a < $b;
! 13: }
! 14:
! 15: }
! 16:
! 17:
! 18: $heap = new MyHeap();
! 19: var_dump($heap->isEmpty());
! 20: $heap->insert(1);
! 21: var_dump($heap->isEmpty());
! 22: $heap->extract();
! 23: var_dump($heap->isEmpty());
! 24: $heap->isEmpty('var');
! 25: ?>
! 26: --EXPECTF--
! 27: bool(true)
! 28: bool(false)
! 29: bool(true)
! 30:
! 31: Warning: SplHeap::isEmpty() expects exactly 0 parameters, 1 given in %s
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>