use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
class AddExpressionLanguageProvidersPassTest extends TestCase
{ public function testProcessForSecurity() { $container =
new ContainerBuilder();
$container->
addCompilerPass(new AddExpressionLanguageProvidersPass());
$definition =
new Definition(\stdClass::
class);
$definition->
addTag('security.expression_language_provider'
);
$container->
setDefinition('some_security_provider',
$definition->
setPublic(true
));
$container->
register('security.expression_language', \stdClass::
class)->
setPublic(true
);
$container->
compile();
$calls =
$container->
getDefinition('security.expression_language'
)->
getMethodCalls();
$this->
assertCount(1,
$calls);
$this->
assertEquals('registerProvider',
$calls[0
][0
]);