use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\ResettableServicePass;
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
use Symfony\Component\HttpKernel\Tests\Fixtures\ClearableService;
use Symfony\Component\HttpKernel\Tests\Fixtures\MultiResettableService;
use Symfony\Component\HttpKernel\Tests\Fixtures\ResettableService;
class ResettableServicePassTest extends TestCase
{ public function testCompilerPass() { $container =
new ContainerBuilder();
$container->
register('one', ResettableService::
class) ->
setPublic(true
) ->
addTag('kernel.reset',
['method' => 'reset'
]);
$container->
register('two', ClearableService::
class) ->
setPublic(true
) ->
addTag('kernel.reset',
['method' => 'clear'
]);
$container->
register('three', MultiResettableService::
class) ->
setPublic(true
) ->
addTag('kernel.reset',
['method' => 'resetFirst'
]) ->
addTag('kernel.reset',
['method' => 'resetSecond'
]);