first commit
This commit is contained in:
34
vendor/ocramius/proxy-manager/tests/language-feature-scripts/access-interceptor-with-cache.phpt
vendored
Normal file
34
vendor/ocramius/proxy-manager/tests/language-feature-scripts/access-interceptor-with-cache.phpt
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Verifies that access interceptor proxy file is generated
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/init.php';
|
||||
|
||||
class Kitchen
|
||||
{
|
||||
private $sweets = 'candy';
|
||||
}
|
||||
|
||||
$configuration->setProxiesTargetDir(__DIR__ . '/cache');
|
||||
$fileLocator = new \ProxyManager\FileLocator\FileLocator($configuration->getProxiesTargetDir());
|
||||
$configuration->setGeneratorStrategy(
|
||||
new \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy($fileLocator)
|
||||
);
|
||||
|
||||
$factory = new \ProxyManager\Factory\AccessInterceptorValueHolderFactory($configuration);
|
||||
|
||||
$proxy = $factory->createProxy(new Kitchen());
|
||||
|
||||
$filename = $fileLocator->getProxyFileName(get_class($proxy));
|
||||
var_dump(file_exists($filename));
|
||||
|
||||
$proxy = $factory->createProxy(new Kitchen());
|
||||
|
||||
var_dump(file_exists($filename));
|
||||
@unlink($filename);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
Reference in New Issue
Block a user