$container->
register('foo', \stdClass::
class)->
setPublic(true
);
$container->
getDefinition('foo'
)->
setLazy(true
)->
addTag('proxy',
['interface' => \stdClass::
class]);
$container->
compile();
$dumper =
new PhpDumper($container);
eval('?>'.
$dumper->
dump(['class' => 'LazyServiceDoctrineBridgeContainer'
]));
} public function testResetService() { $container =
new \
LazyServiceDoctrineBridgeContainer();
$registry =
new TestManagerRegistry('name',
[],
['defaultManager' => 'foo'
], 'defaultConnection', 'defaultManager', 'proxyInterfaceName'
);
$registry->
setTestContainer($container);
$foo =
$container->
get('foo'
);
$foo->bar = 123;
$this->
assertTrue(isset($foo->bar
));
$registry->
resetManager();
$this->
assertSame($foo,
$container->
get('foo'
));