diff options
Diffstat (limited to 'ext/spl/tests/spl_heap_isempty.phpt')
-rw-r--r-- | ext/spl/tests/spl_heap_isempty.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_heap_isempty.phpt b/ext/spl/tests/spl_heap_isempty.phpt new file mode 100644 index 0000000..2729c7f --- /dev/null +++ b/ext/spl/tests/spl_heap_isempty.phpt @@ -0,0 +1,21 @@ +--TEST-- +SPL: Test of isEmpty for SPL Max Heap +--CREDITS-- +Rohan Abraham (rohanabrahams@gmail.com) +TestFest London May 2009 +--FILE-- +<?php + $h = new SplMaxHeap(); + echo "Checking a new heap is empty: "; + var_dump($h->isEmpty())."\n"; + $h->insert(2); + echo "Checking after insert: "; + var_dump($h->isEmpty())."\n"; + $h->extract(); + echo "Checking after extract: "; + var_dump($h->isEmpty())."\n"; +?> +--EXPECT-- +Checking a new heap is empty: bool(true) +Checking after insert: bool(false) +Checking after extract: bool(true)
\ No newline at end of file |