Skip to content

Instantly share code, notes, and snippets.

@bamarni
Created October 22, 2013 11:21
Show Gist options
  • Save bamarni/7098930 to your computer and use it in GitHub Desktop.
Save bamarni/7098930 to your computer and use it in GitHub Desktop.
--TEST--
Verifies that lazy loading value holder factory can generate proxy for PHP core classes.
--FILE--
<?php
require_once __DIR__ . '/init.php';
class SplClass extends \ArrayObject
{
public function getTrue()
{
return true;
}
}
$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($configuration);
$proxy = $factory->createProxy('SplClass', function (& $wrapped, $proxy, $method, array $parameters, & $initializer) {
$initializer = null;
$wrapped = new SplClass();
});
var_dump($proxy->getTrue());
?>
--EXPECT--
bool(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment