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

23 lines
556 B
PHP

--TEST--
Verifies that generated lazy loading value holders disallow protected property direct write
--FILE--
<?php
require_once __DIR__ . '/init.php';
class Kitchen
{
protected $sweets;
}
$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($configuration);
$proxy = $factory->createProxy('Kitchen', function (& $wrapped, $proxy, $method, array $parameters, & $initializer) {
$initializer = null;
$wrapped = new Kitchen();
});
$proxy->sweets = 'stolen';
?>
--EXPECTF--
%SFatal error: Cannot %s property%sin %s on line %d