Created
October 22, 2013 11:21
-
-
Save bamarni/7098930 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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