summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt
diff options
context:
space:
mode:
authorGabriel Caruso <carusogabriel34@gmail.com>2018-02-18 21:34:17 -0300
committerJoe Watkins <krakjoe@php.net>2018-02-19 08:26:34 +0100
commit6d785a7a00729bdd046e7ab9d84bd5f2a71e9406 (patch)
treef6fd8b9afe48bdfcbfa4d3dc9e16805cf6c1663e /ext/spl/tests/SplDoublyLinkedList_top_empty.phpt
parent34833c9d397dc2eab1a70885d64081e28ac026b0 (diff)
downloadphp-git-6d785a7a00729bdd046e7ab9d84bd5f2a71e9406.tar.gz
Test more functionalities of SPL
Diffstat (limited to 'ext/spl/tests/SplDoublyLinkedList_top_empty.phpt')
-rw-r--r--ext/spl/tests/SplDoublyLinkedList_top_empty.phpt14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt b/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt
new file mode 100644
index 0000000000..644e54bb9a
--- /dev/null
+++ b/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt
@@ -0,0 +1,14 @@
+--TEST--
+SplDoublyLinkedList::top empty
+--CREDITS--
+Gabriel Caruso (carusogabriel34@gmail.com)
+--FILE--
+<?php
+try {
+ (new SplDoublyLinkedList)->top();
+} catch (RuntimeException $e) {
+ echo $e->getMessage();
+}
+?>
+--EXPECT--
+Can't peek at an empty datastructure