class ContainerBuilderTest extends TestCase
{ public function testCreateProxyServiceWithRuntimeInstantiator() { $builder =
new ContainerBuilder();
$builder->
setProxyInstantiator(new RuntimeInstantiator());
$builder->
register('foo1', \ProxyManagerBridgeFooClass::
class)->
setFile(__DIR__.'/Fixtures/includes/foo.php'
)->
setPublic(true
);
$builder->
getDefinition('foo1'
)->
setLazy(true
)->
addTag('proxy',
['interface' => \ProxyManagerBridgeFooClass::
class]);
$builder->
compile();
/* @var $foo1 \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface */
$foo1 =
$builder->
get('foo1'
);
$foo1->
__destruct();
$this->
assertSame(0,
$foo1::
$destructorCount);