]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/pimple/pimple/ext/pimple/tests/008.phpt
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / pimple / pimple / ext / pimple / tests / 008.phpt
diff --git a/vendor/pimple/pimple/ext/pimple/tests/008.phpt b/vendor/pimple/pimple/ext/pimple/tests/008.phpt
new file mode 100644 (file)
index 0000000..db7eeec
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+Test frozen services
+--SKIPIF--
+<?php if (!extension_loaded("pimple")) print "skip"; ?>
+--FILE--
+<?php 
+$p = new Pimple\Container();
+$p[42] = 'foo';
+$p[42] = 'bar';
+
+$p['foo'] = function () { };
+$p['foo'] = function () { };
+
+$a = $p['foo'];
+
+try {
+       $p['foo'] = function () { };
+       echo "Exception excpected";
+} catch (RuntimeException $e) { }
+
+$p[42] = function() { };
+$a = $p[42];
+
+try {
+       $p[42] = function () { };
+       echo "Exception excpected";
+} catch (RuntimeException $e) { }
+?>
+--EXPECTF--