[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/ocramius/proxy-manager/tests/language-feature-scripts/ -> access-interceptor-scope-localizer-denies-private-property-read.phpt (source)

   1  --TEST--
   2  Verifies that generated access interceptors disallow private property direct read
   3  --SKIPIF--
   4  <?php
   5  if (! method_exists('Closure', 'bind')) {
   6      echo 'skip PHP 5.4+ is needed to localize private properties';
   7  }
   8  ?>
   9  --FILE--
  10  <?php
  11  
  12  require_once  __DIR__ . '/init.php';
  13  
  14  class Kitchen
  15  {
  16      private $sweets;
  17  }
  18  
  19  $factory = new \ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory($configuration);
  20  
  21  $proxy = $factory->createProxy(new Kitchen());
  22  
  23  $proxy->sweets;
  24  ?>
  25  --EXPECTF--
  26  %SFatal error: Cannot access private property %s::$sweets in %s on line %d


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1