diff options
Diffstat (limited to 'ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt')
-rw-r--r-- | ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt b/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt new file mode 100644 index 0000000000..b94b067f4d --- /dev/null +++ b/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt @@ -0,0 +1,13 @@ +--TEST-- +Check that SplDoublyLinkedList::add throws an exception with an invalid offset argument +--FILE-- +<?php +try { + $dll = new SplDoublyLinkedList(); + var_dump($dll->add(12,'Offset 12 should not exist')); +} catch (OutOfRangeException $e) { + echo "Exception: ".$e->getMessage()."\n"; +} +?> +--EXPECTF-- +Exception: Offset invalid or out of range |