Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..
Decoded Output download
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\LoginLinkFactory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class LoginLinkFactoryTest extends TestCase
{
public function testBasicServiceConfiguration()
{
$container = new ContainerBuilder();
$config = [
'check_route' => 'app_check_login_link',
'lifetime' => 500,
'signature_properties' => ['email', 'password'],
'success_handler' => 'success_handler_service_id',
'failure_handler' => 'failure_handler_service_id',
];
$factory = new LoginLinkFactory();
$finalizedConfig = $this->processConfig($config, $factory);
$factory->createAuthenticator($container, 'firewall1', $finalizedConfig, 'userprovider');
$this->assertTrue($container->hasDefinition('security.authenticator.login_link'));
$this->assertTrue($container->hasDefinition('security.authenticator.login_link_handler.firewall1'));
}
private function processConfig(array $config, LoginLinkFactory $factory)
{
$nodeDefinition = new ArrayNodeDefinition('login-link');
$factory->addConfiguration($nodeDefinition);
$node = $nodeDefinition->getNode();
$normalizedConfig = $node->normalize($config);
return $node->finalize($normalizedConfig);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\LoginLinkFactory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class LoginLinkFactoryTest extends TestCase
{
public function testBasicServiceConfiguration()
{
$container = new ContainerBuilder();
$config = [
'check_route' => 'app_check_login_link',
'lifetime' => 500,
'signature_properties' => ['email', 'password'],
'success_handler' => 'success_handler_service_id',
'failure_handler' => 'failure_handler_service_id',
];
$factory = new LoginLinkFactory();
$finalizedConfig = $this->processConfig($config, $factory);
$factory->createAuthenticator($container, 'firewall1', $finalizedConfig, 'userprovider');
$this->assertTrue($container->hasDefinition('security.authenticator.login_link'));
$this->assertTrue($container->hasDefinition('security.authenticator.login_link_handler.firewall1'));
}
private function processConfig(array $config, LoginLinkFactory $factory)
{
$nodeDefinition = new ArrayNodeDefinition('login-link');
$factory->addConfiguration($nodeDefinition);
$node = $nodeDefinition->getNode();
$normalizedConfig = $node->normalize($config);
return $node->finalize($normalizedConfig);
}
}
Function Calls
None |
Stats
MD5 | cd044ad1e595443ee75b1a2f907df2a3 |
Eval Count | 0 |
Decode Time | 93 ms |