Files
san-reymoros/vendor/ocramius/proxy-manager/tests/language-feature-scripts/access-interceptor-scope-localizer-denies-private-property-write.phpt
Gauvain Boiché 5e4c5f9418 Ajout du FR
Ajout du FR + correction du "functions.php"
2020-03-30 14:52:34 +02:00

27 lines
552 B
PHP

--TEST--
Verifies that generated access interceptors disallow private property direct write
--SKIPIF--
<?php
if (! method_exists('Closure', 'bind')) {
echo 'skip PHP 5.4+ is needed to localize private properties';
}
?>
--FILE--
<?php
require_once __DIR__ . '/init.php';
class Kitchen
{
private $sweets;
}
$factory = new \ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory($configuration);
$proxy = $factory->createProxy(new Kitchen());
$proxy->sweets = 'stolen';
?>
--EXPECTF--
%SFatal error: Cannot %s property%sin %s on line %d