summaryrefslogtreecommitdiff
path: root/ext/spl/tests/pqueue_004.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/pqueue_004.phpt')
-rw-r--r--ext/spl/tests/pqueue_004.phpt54
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/spl/tests/pqueue_004.phpt b/ext/spl/tests/pqueue_004.phpt
new file mode 100644
index 0000000..3a86f9e
--- /dev/null
+++ b/ext/spl/tests/pqueue_004.phpt
@@ -0,0 +1,54 @@
+--TEST--
+SPL: SplPriorityQueue: var_dump
+--FILE--
+<?php
+$pq = new SplPriorityQueue();
+
+$pq->insert("a", 0);
+$pq->insert("b", 1);
+$pq->insert("c", 5);
+$pq->insert("d", -2);
+
+var_dump($pq);
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+object(SplPriorityQueue)#1 (3) {
+ ["flags":"SplPriorityQueue":private]=>
+ int(1)
+ ["isCorrupted":"SplPriorityQueue":private]=>
+ bool(false)
+ ["heap":"SplPriorityQueue":private]=>
+ array(4) {
+ [0]=>
+ array(2) {
+ ["data"]=>
+ string(1) "c"
+ ["priority"]=>
+ int(5)
+ }
+ [1]=>
+ array(2) {
+ ["data"]=>
+ string(1) "a"
+ ["priority"]=>
+ int(0)
+ }
+ [2]=>
+ array(2) {
+ ["data"]=>
+ string(1) "b"
+ ["priority"]=>
+ int(1)
+ }
+ [3]=>
+ array(2) {
+ ["data"]=>
+ string(1) "d"
+ ["priority"]=>
+ int(-2)
+ }
+ }
+}
+===DONE===