]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/pimple/pimple/ext/pimple/tests/011.phpt
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / pimple / pimple / ext / pimple / tests / 011.phpt
diff --git a/vendor/pimple/pimple/ext/pimple/tests/011.phpt b/vendor/pimple/pimple/ext/pimple/tests/011.phpt
new file mode 100644 (file)
index 0000000..6682ab8
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Test service callback throwing an exception
+--SKIPIF--
+<?php if (!extension_loaded("pimple")) print "skip"; ?>
+--FILE--
+<?php
+class CallBackException extends RuntimeException { }
+
+$p = new Pimple\Container();
+$p['foo'] = function () { throw new CallBackException; };
+try {
+       echo $p['foo'] . "\n";
+       echo "should not come here";
+} catch (CallBackException $e) {
+       echo "all right!";
+}
+?>
+--EXPECTF--
+all right!
\ No newline at end of file