"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/composer/pimple/pimple/ext/pimple/tests/017_1.phpt" (8 Apr 2021, 385 Bytes) of package /linux/www/studip-4.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 Test extend() with exception in service factory
    3 --SKIPIF--
    4 <?php if (!extension_loaded("pimple")) print "skip"; ?>
    5 --FILE--
    6 <?php
    7 
    8 $p = new Pimple\Container();
    9 $p[12] = function ($v) { throw new BadMethodCallException; };
   10 
   11 $c = $p->extend(12, function ($w) { return 'foobar'; });
   12 
   13 try {
   14     $p[12];
   15     echo "Exception expected";
   16 } catch (BadMethodCallException $e) { }
   17 --EXPECTF--