"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/libs/composer/vendor/pimple/pimple/ext/pimple/tests/014.phpt" (24 Jan 2020, 520 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 Test raw()
    3 --SKIPIF--
    4 <?php if (!extension_loaded("pimple")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 
    8 $p = new Pimple\Container();
    9 $f = function () { var_dump('called-2'); return 'ret-2'; };
   10 
   11 $p['foo'] = $f;
   12 $p[42]    = $f;
   13 
   14 var_dump($p['foo']);
   15 var_dump($p->raw('foo'));
   16 var_dump($p[42]);
   17 
   18 unset($p['foo']);
   19 
   20 try {
   21 	$p->raw('foo');
   22 	echo "expected exception";
   23 } catch (InvalidArgumentException $e) { }
   24 --EXPECTF--
   25 string(8) "called-2"
   26 string(5) "ret-2"
   27 object(Closure)#%i (0) {
   28 }
   29 string(8) "called-2"
   30 string(5) "ret-2"