prefix
stringlengths
512
512
suffix
stringlengths
256
256
middle
stringlengths
14
229
meta
dict
; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; /** * @author Marcin Sikon <marcin.sikon@gmail.com>...
me(410, $e->getStatusCode()); } try { $controller->redirectAction($request, '', false); $this->fail('Expected Symfony\Component\HttpKernel\Exception\HttpException to be thrown'); } catch (HttpException $e) {
$controller->redirectAction($request, '', true); $this->fail('Expected Symfony\Component\HttpKernel\Exception\HttpException to be thrown'); } catch (HttpException $e) { $this->assertSa
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php", "language": "php", "file_size": 16751, "cut_index": 921, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use Psr\Container\ContainerInterface; use Symfo...
} public function setContainer(ContainerInterface $container): ?ContainerInterface { if (!$this->throwOnUnexpectedService) { return parent::setContainer($container); } $expected = self::getSubscribedServic
($throwOnUnexpectedService = true) { $this->throwOnUnexpectedService = $throwOnUnexpectedService; } public function __call(string $method, array $arguments) { return $this->$method(...$arguments);
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TestAbstractController.php", "language": "php", "file_size": 1836, "cut_index": 537, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\CacheWarmer\SerializerCacheWarmer; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\Cache\Adapter\NullAdapter; use Symf...
his->arrayPool)) { $this->arrayPool->clear(); unset($this->arrayPool); } } private function getArrayPool(string $file): PhpArrayAdapter { return $this->arrayPool = new PhpArrayAdapter($file, new NullAdap
erializer\Mapping\Loader\YamlFileLoader; class SerializerCacheWarmerTest extends TestCase { private PhpArrayAdapter $arrayPool; protected function tearDown(): void { parent::tearDown(); if (isset($t
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php", "language": "php", "file_size": 6642, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\Attributes\DataProvider; use...
arer\Psr6CacheClearer; use Symfony\Component\HttpKernel\KernelInterface; class CachePoolClearCommandTest extends TestCase { #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions)
Bundle\Tests\TestCase; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpKernel\CacheCle
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolClearCommandTest.php", "language": "php", "file_size": 1954, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Bundle\FrameworkBundle\Command\CachePoolPruneCommand; use Symfony\Bund...
lic function testCommandWithPools() { $tester = $this->getCommandTester($this->getKernel(), $this->getRewindableGenerator()); $tester->execute([]); } public function testCommandWithNoPools() { $tester = $this->getCo
se Symfony\Component\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpKernel\KernelInterface; class CachePruneCommandTest extends TestCase { pub
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePruneCommandTest.php", "language": "php", "file_size": 4265, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\R...
; use Symfony\Component\Routing\RouterInterface; class RouterMatchCommandTest extends TestCase { public function testWithMatchPath() { $tester = $this->createCommandTester(); $ret = $tester->execute(['path_info' => '/foo', 'foo'],
e Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\Route; use Symfony\Component\Routing\RouteCollection
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php", "language": "php", "file_size": 2821, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\Attributes\DataProvider; use...
$vault = $this->createStub(AbstractVault::class); $vault->method('list')->willReturn(['SECRET' => null, 'OTHER_SECRET' => null]); if ($withLocalVault) { $localVault = $this->createStub(AbstractVault::class); $
mandCompletionTester; class SecretsRemoveCommandTest extends TestCase { #[DataProvider('provideCompletionSuggestions')] public function testComplete(bool $withLocalVault, array $input, array $expectedSuggestions) {
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsRemoveCommandTest.php", "language": "php", "file_size": 1704, "cut_index": 537, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\Attributes\BackupGlobals; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\Secr...
n(['secretKey' => 'secretValue']); $command = new SecretsRevealCommand($vault); $tester = new CommandTester($command); $this->assertSame(Command::SUCCESS, $tester->execute(['name' => 'secretKey'])); $this->assertEquals('s
omponent\Console\Tester\CommandTester; class SecretsRevealCommandTest extends TestCase { public function testExecute() { $vault = $this->createStub(AbstractVault::class); $vault->method('list')->willRetur
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsRevealCommandTest.php", "language": "php", "file_size": 3368, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\XliffLintCommand; use Symfony\Bundle\FrameworkBundle...
he * rest of the features are tested in the Translation component. * * @author Javier Eguiluz <javier.eguiluz@gmail.com> */ class XliffLintCommandTest extends TestCase { private array $files; public function testGetHelp() { $comman
fony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\HttpKernel\KernelInterface; /** * Tests the part of the XliffLintCommand managed by the FrameworkBundle. T
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php", "language": "php", "file_size": 3622, "cut_index": 614, "middle_length": 229 }
dle\Translation\Translator; use Symfony\Component\Config\Resource\DirectoryResource; use Symfony\Component\Config\Resource\FileExistenceResource; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Translation\Exception\InvalidArgumentException; use Sy...
get_temp_dir().'/sf_translation'; $this->deleteTmpDir(); } protected function tearDown(): void { $this->deleteTmpDir(); } protected function deleteTmpDir() { if (!file_exists($dir = $this->tmpDir)) {
\Translation\MessageCatalogue; use Symfony\Contracts\Translation\TranslatorInterface; class TranslatorTest extends TestCase { protected string $tmpDir; protected function setUp(): void { $this->tmpDir = sys_
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php", "language": "php", "file_size": 15795, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface as Psr11ContainerInterface; use Psr\Log\LoggerInterface...
this->expectExceptionMessage('"Symfony\\Bundle\\FrameworkBundle\\Tests\\Controller\\TestAbstractController" has no container set, did you forget to define it as a service subscriber?'); class_exists(AbstractControllerTest::class); $contro
ymfony\Component\HttpFoundation\Request; class ControllerResolverTest extends TestCase { public function testAbstractControllerGetsContainerWhenNotSet() { $this->expectException(\LogicException::class); $
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php", "language": "php", "file_size": 4590, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Controller\TemplateController; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Twi...
ray_map(strval(...), $templateActionRef->getParameters()), array_map(strval(...), $invokeRef->getParameters()), ); } public function testTwig() { $twig = $this->createMock(Environment::class); $twig->expects
) { $ref = new \ReflectionClass(TemplateController::class); $templateActionRef = $ref->getMethod('templateAction'); $invokeRef = $ref->getMethod('__invoke'); $this->assertSame( ar
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/TemplateControllerTest.php", "language": "php", "file_size": 4411, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\Cache\Adapter\NullAdapter; use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use...
getArrayPool(string $file): PhpArrayAdapter { return $this->arrayPool = new PhpArrayAdapter($file, new NullAdapter()); } public function testWarmUp() { $validatorBuilder = new ValidatorBuilder(); $validatorBuilder-
protected function tearDown(): void { parent::tearDown(); if (isset($this->arrayPool)) { $this->arrayPool->clear(); unset($this->arrayPool); } } private function
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ValidatorCacheWarmerTest.php", "language": "php", "file_size": 7839, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Comma...
esystem $fs; protected function setUp(): void { $this->vaultDir = sys_get_temp_dir().'/sf_secrets/vault_'.uniqid(); $this->localVaultDir = sys_get_temp_dir().'/sf_secrets/local_'.uniqid(); $this->fs = new Filesystem();
dTester; use Symfony\Component\Filesystem\Filesystem; #[RequiresPhpExtension('sodium')] class SecretsEncryptFromLocalCommandTest extends TestCase { private string $vaultDir; private string $localVaultDir; private Fil
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsEncryptFromLocalCommandTest.php", "language": "php", "file_size": 3613, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\YamlLintCommand; use Symfony\Bundle\FrameworkBundle\...
.com> */ class YamlLintCommandTest extends TestCase { private array $files; public function testLintCorrectFile() { $tester = $this->createCommandTester(); $filename = $this->createFile('foo: bar'); $tester->execute(
ony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\HttpKernel\KernelInterface; /** * Tests the YamlLintCommand. * * @author Robin Chalas <robin.chalas@gmail
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php", "language": "php", "file_size": 5011, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Kernel; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; use Symfony\Bundle\Frame...
use MicroKernelTrait { configureRoutes as traitConfigureRoutes; } private string $cacheDir; public function halloweenAction(\stdClass $o) { return new Response($o->halloween); } #[Route('/easter')] public func
Foundation\Response; use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; class FlexStyleMicroKernel extends Kernel {
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php", "language": "php", "file_size": 2810, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Cache...
nterface::class); $routerMock->expects($this->once())->method('warmUp')->with('/tmp/cache', '/tmp/build')->willReturn([]); $container->set('router', $routerMock); $routerCacheWarmer = new RouterCacheWarmer($container); $ro
lass RouterCacheWarmerTest extends TestCase { public function testWarmUpWithWarmableInterfaceWithBuildDir() { $container = new Container(); $routerMock = $this->createMock(testRouterInterfaceWithWarmableI
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php", "language": "php", "file_size": 2986, "cut_index": 563, "middle_length": 229 }
Command\TranslationDebugCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\ExtensionWithoutConfigTestBundle\ExtensionWithoutConfigTestBundle; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandCompletionTest...
anslator; class TranslationDebugCommandTest extends TestCase { private Filesystem $fs; private string $translationDir; public function testDebugMissingMessages() { $tester = $this->createCommandTester(['foo' => 'foo']); $r
e\BundleInterface; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Translation\Extractor\ExtractorInterface; use Symfony\Component\Translation\Reader\TranslationReader; use Symfony\Component\Translation\Tr
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php", "language": "php", "file_size": 10981, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Psr\Cache\CacheItemPoolInterfac...
ernel\CacheClearer\Psr6CacheClearer; use Symfony\Component\HttpKernel\KernelInterface; class CachePoolDeleteCommandTest extends TestCase { public function testCommandWithValidKey() { $cachePool = $this->createMock(CacheItemPoolInterface::c
ponent\Cache\Adapter\ArrayAdapter; use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpK
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolDeleteCommandTest.php", "language": "php", "file_size": 4321, "cut_index": 614, "middle_length": 229 }
Flow\FormFlowBuilderInterface; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormConfigInterface; use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\HttpFound...
HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpKernel\Exception\NotFoundH
sponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php", "language": "php", "file_size": 27199, "cut_index": 1331, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Bundle\FrameworkBundle\DataCollector\TemplateAwar...
ilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (false === $container->hasDefinition('profiler')) { return; } $definition = $container->getDefinition('
njection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Reference; /** * Adds tagged data_collector services to profiler service. * * @author Fabien Potencier <fabien@symfony.com> */ class Prof
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php", "language": "php", "file_size": 2330, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Routing; use Symfony\Component\DependencyInjection\Config\Containe...
rivate readonly array $logoutUris, private readonly string $parameterName, ) { } public function __invoke(): RouteCollection { $collection = new RouteCollection(); $collection->addResource(new ContainerParametersRes
s Logout URIs indexed by the corresponding firewall name * @param string $parameterName Name of the container parameter containing {@see $logoutUris} value */ public function __construct( p
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Routing/LogoutRouteLoader.php", "language": "php", "file_size": 1559, "cut_index": 537, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Component\Security\Core\Authentica...
parent::__construct($roles); if (null !== $user) { $this->setUser($user); } } public function getFirewallName(): string { return $this->firewallName; } public function getCredentials(): mixed
ong <wouter@wouterj.nl> */ class TestBrowserToken extends AbstractToken { public function __construct( array $roles = [], ?UserInterface $user = null, private string $firewallName = 'main', ) {
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/TestBrowserToken.php", "language": "php", "file_size": 1323, "cut_index": 524, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\RememberMe; use Symfony\Component\Security\Core...
private RememberMeHandlerInterface $handler, ) { } public function createRememberMeCookie(UserInterface $user): void { $this->handler->createRememberMeCookie($user); } public function consumeRememberMeCookie(Remembe
for tagging aliases in the RememberMeFactory. * * @author Wouter de Jong <wouter@wouterj.nl> * * @internal */ final class DecoratedRememberMeHandler implements RememberMeHandlerInterface { public function __construct(
{ "filepath": "src/Symfony/Bundle/SecurityBundle/RememberMe/DecoratedRememberMeHandler.php", "language": "php", "file_size": 1251, "cut_index": 518, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\RememberMe; use Psr\Container\ContainerInterface; use Symfony\Bund...
rewall. * * @author Wouter de Jong <wouter@wouterj.nl> */ final class FirewallAwareRememberMeHandler implements RememberMeHandlerInterface { use FirewallAwareTrait; private const FIREWALL_OPTION = 'remember_me'; public function __construct
er\UserInterface; use Symfony\Component\Security\Http\RememberMe\RememberMeDetails; use Symfony\Component\Security\Http\RememberMe\RememberMeHandlerInterface; /** * Decorates {@see RememberMeHandlerInterface} for the current fi
{ "filepath": "src/Symfony/Bundle/SecurityBundle/RememberMe/FirewallAwareRememberMeHandler.php", "language": "php", "file_size": 1740, "cut_index": 537, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\LoginLink; use Psr\Container\ContainerInterface; use Symfony\Bundl...
ink handler for the current firewall. * * @author Ryan Weaver <ryan@symfonycasts.com> */ class FirewallAwareLoginLinkHandler implements LoginLinkHandlerInterface { use FirewallAwareTrait; private const FIREWALL_OPTION = 'login_link'; publi
Stack; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Http\LoginLink\LoginLinkDetails; use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface; /** * Decorates the login l
{ "filepath": "src/Symfony/Bundle/SecurityBundle/LoginLink/FirewallAwareLoginLinkHandler.php", "language": "php", "file_size": 1670, "cut_index": 537, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle...
ervice('security.access.decision_manager'), service('security.firewall.map'), service('debug.security.firewall')->nullOnInvalid(), ]) ->tag('data_collector', [ 'template' => '@Security
taCollector::class) ->args([ service('security.untracked_token_storage'), service('security.role_hierarchy'), service('security.logout_url_generator'), s
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/collectors.php", "language": "php", "file_size": 1130, "cut_index": 518, "middle_length": 229 }
ackage. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\SecurityBundle\Command\DebugFirewallComm...
service('security.firewall.context_locator'), tagged_locator('event_dispatcher.dispatcher', 'name'), [], false, ]) ->tag('console.command', ['command' => 'debug:firewall'])
param('security.firewalls'),
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/debug_console.php", "language": "php", "file_size": 874, "cut_index": 559, "middle_length": 52 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\Form\Extension\Core\Type\FormType; use Sy...
swordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; return static function (ContainerConfigurator $container) { $co
sher\Type\FormTypePasswordHasherExtension; use Symfony\Component\Form\Extension\PasswordHasher\Type\PasswordTypePasswordHasherExtension; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory; use Symfony\Component\Pas
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/password_hasher.php", "language": "php", "file_size": 2358, "cut_index": 563, "middle_length": 229 }
e\EventListener\FirewallListener; use Symfony\Bundle\SecurityBundle\Routing\LogoutRouteLoader; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Bundle\SecurityBundle\Security\FirewallConfig; use Symfony\Bundle\SecurityBundle\Security\FirewallContext; use Symfony\Bundle\SecurityBundle\Security\FirewallMap; use Sy...
ymfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage; use Symfony\Component\Security\Core\Authorization\AccessDecisionManager; use Symf
nLanguage; use Symfony\Component\Ldap\Security\LdapUserProvider; use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use S
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security.php", "language": "php", "file_size": 14887, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\SecurityBundle\Security\UserAuthenticator; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Security\Http\Authentication\AuthenticatorManager; use Symfony\Component\S...
use Symfony\Component\Security\Http\Event\CheckPassportEvent; use Symfony\Component\Security\Http\EventListener\CheckCredentialsListener; use Symfony\Component\Security\Http\EventListener\LoginThrottlingListener; use Symfony\Component\Security\Http\EventL
henticator; use Symfony\Component\Security\Http\Authenticator\JsonLoginAuthenticator; use Symfony\Component\Security\Http\Authenticator\RemoteUserAuthenticator; use Symfony\Component\Security\Http\Authenticator\X509Authenticator;
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.php", "language": "php", "file_size": 6821, "cut_index": 716, "middle_length": 229 }
omponent\Core\JWK; use Jose\Component\Core\JWKSet; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128CBCHS256; use Jose\Component\Encryption\Algorithm\ContentEncryption\A128GCM; use Jose\Component\Encryption\Algorithm\ContentEncryption\A192CBCHS384; use Jose\Component\Encryption\Algorithm\ContentEncryption\...
S384; use Jose\Component\Signature\Algorithm\ES512; use Jose\Component\Signature\Algorithm\PS256; use Jose\Component\Signature\Algorithm\PS384; use Jose\Component\Signature\Algorithm\PS512; use Jose\Component\Signature\Algorithm\RS256; use Jose\Component\S
ncryption\ECDHES; use Jose\Component\Encryption\Algorithm\KeyEncryption\ECDHSS; use Jose\Component\Encryption\Algorithm\KeyEncryption\RSAOAEP; use Jose\Component\Signature\Algorithm\ES256; use Jose\Component\Signature\Algorithm\E
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_access_token.php", "language": "php", "file_size": 9954, "cut_index": 921, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\SecurityBundle\LoginLink\FirewallAwareLoginL...
tic function (ContainerConfigurator $container) { $container->services() ->set('security.authenticator.login_link', LoginLinkAuthenticator::class) ->abstract() ->args([ abstract_arg('the login link handle
asher; use Symfony\Component\Security\Http\Authenticator\LoginLinkAuthenticator; use Symfony\Component\Security\Http\LoginLink\LoginLinkHandler; use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface; return sta
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_login_link.php", "language": "php", "file_size": 2854, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\SecurityBundle\RememberMe\FirewallAwareRememberMeHandler; use Symfony\Component\DependencyInjec...
RememberMe\RememberMeHandlerInterface; use Symfony\Component\Security\Http\RememberMe\ResponseListener; use Symfony\Component\Security\Http\RememberMe\SignatureRememberMeHandler; return static function (ContainerConfigurator $container) { $container->
entListener\CheckRememberMeConditionsListener; use Symfony\Component\Security\Http\EventListener\RememberMeListener; use Symfony\Component\Security\Http\RememberMe\PersistentRememberMeHandler; use Symfony\Component\Security\Http\
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_remember_me.php", "language": "php", "file_size": 4098, "cut_index": 614, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\SecurityBundle\Deb...
->args([ service('debug.security.access.decision_manager.inner'), ]) ->tag('kernel.reset', ['method' => 'reset', 'on_invalid' => 'ignore']) ->set('debug.security.voter.vote_listener', VoteListener::cl
ction (ContainerConfigurator $container) { $container->services() ->set('debug.security.access.decision_manager', TraceableAccessDecisionManager::class) ->decorate('security.access.decision_manager')
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_debug.php", "language": "php", "file_size": 1615, "cut_index": 537, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Security\Http\AccessMap; use Symfony\Component\Security\Http\Authentication\CustomAuthenticationFailureHandler; use Symfony\Component\Se...
ecurity\Http\EventListener\DefaultLogoutListener; use Symfony\Component\Security\Http\EventListener\SessionLogoutListener; use Symfony\Component\Security\Http\Firewall\AccessListener; use Symfony\Component\Security\Http\Firewall\ChannelListener; use Symfon
ntication\DefaultAuthenticationSuccessHandler; use Symfony\Component\Security\Http\EventListener\ClearSiteDataLogoutListener; use Symfony\Component\Security\Http\EventListener\CookieClearingLogoutListener; use Symfony\Component\S
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/security_listeners.php", "language": "php", "file_size": 7375, "cut_index": 716, "middle_length": 229 }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\...
y', SecurityExtension::class) ->args([ service('security.authorization_checker')->ignoreOnInvalid(), service('security.impersonate_url_generator')->ignoreOnInvalid(), ]) ->tag('twig.extens
>set('twig.extension.logout_url', LogoutUrlExtension::class) ->args([ service('security.logout_url_generator'), ]) ->tag('twig.extension') ->set('twig.extension.securit
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Resources/config/templating_twig.php", "language": "php", "file_size": 1012, "cut_index": 512, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\CacheWarmer; use Symfony\Component\ExpressionLa...
Language, ) { } public function isOptional(): bool { return true; } public function warmUp(string $cacheDir, ?string $buildDir = null): array { foreach ($this->expressions as $expression) { $this->e
mplements CacheWarmerInterface { /** * @param iterable<mixed, Expression|string> $expressions */ public function __construct( private iterable $expressions, private ExpressionLanguage $expression
{ "filepath": "src/Symfony/Bundle/SecurityBundle/CacheWarmer/ExpressionCacheWarmer.php", "language": "php", "file_size": 1163, "cut_index": 518, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\SecurityBundle\Command; use Psr\Container\ContainerInterface; use Symfony\Bundle\SecurityBundle\Security\FirewallContext; use Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\C...
nt\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator; /** * @author Timo Bakx <timobakx@gmail.com> */ #[AsCo
ent; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Compone
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Command/DebugFirewallCommand.php", "language": "php", "file_size": 9072, "cut_index": 716, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Co...
o dump the role hierarchy as a Mermaid flowchart. * * @author Damien Fernandes <damien.fernandes24@gmail.com> */ #[AsCommand(name: 'debug:security:role-hierarchy', description: 'Dump the role hierarchy as a Mermaid flowchart')] class SecurityRoleHierarc
Console\Style\SymfonyStyle; use Symfony\Component\Security\Core\Dumper\MermaidDirection; use Symfony\Component\Security\Core\Dumper\MermaidDumper; use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; /** * Command t
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Command/SecurityRoleHierarchyDumpCommand.php", "language": "php", "file_size": 2837, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\EventListener; use Symfony\Bundle\SecurityBundle\Security\FirewallMap; use Symfony\Component...
sser@gmail.com> */ class FirewallListener extends Firewall { public function __construct( private FirewallMapInterface $map, EventDispatcherInterface $dispatcher, private LogoutUrlGenerator $logoutUrlGenerator, ) {
ony\Component\Security\Http\FirewallMapInterface; use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; /** * @author Maxime Steinhausser <maxime.steinhau
{ "filepath": "src/Symfony/Bundle/SecurityBundle/EventListener/FirewallListener.php", "language": "php", "file_size": 2043, "cut_index": 563, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\EventListener; use Symfony\Component\EventDispa...
cessDecisionManager $traceableAccessDecisionManager, ) { } public function onVoterVote(VoteEvent $event): void { $this->traceableAccessDecisionManager->addVoterVote($event->getVoter(), $event->getAttributes(), $event->getVote(), $e
ents from traceable voters. * * @author Laurent VOULLEMIER <laurent.voullemier@gmail.com> * * @internal */ class VoteListener implements EventSubscriberInterface { public function __construct( private TraceableAc
{ "filepath": "src/Symfony/Bundle/SecurityBundle/EventListener/VoteListener.php", "language": "php", "file_size": 1172, "cut_index": 518, "middle_length": 229 }
e Symfony\Component\Security\Core\Authentication\Token\NullToken; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authorization\AccessDecision; use Symfony\Component\Securit...
face; use Symfony\Component\Security\Http\Authentication\UserAuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component
ption; use Symfony\Component\Security\Core\User\InMemoryUser; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInter
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/SecurityTest.php", "language": "php", "file_size": 21466, "cut_index": 1331, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase; us...
response, 0, $p + 3) : $response)); self::assertEquals('http://localhost'.$location, $response->headers->get('Location')); } public static function setUpBeforeClass(): void { static::deleteTmpDir(); } public static fun
se extends BaseWebTestCase { public static function assertRedirect($response, $location) { self::assertTrue($response->isRedirect(), "Response is not a redirect, got:\n".(($p = strpos($response, '-->')) ? substr($
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/AbstractWebTestCase.php", "language": "php", "file_size": 2238, "cut_index": 563, "middle_length": 229 }
ibutes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Response\MockResponse; use Symfony\Component\HttpFoundation\Response; class Acce...
} public function testNoTokenExtractorsConfiguredShouldFail() { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('The path "security.firewalls.main.access_token.token_extractors" shou
->expectExceptionMessage('The child config "token_handler" under "security.firewalls.main.access_token" must be configured.'); $this->createClient(['test_case' => 'AccessToken', 'root_config' => 'config_no_handler.yml']);
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/AccessTokenTest.php", "language": "php", "file_size": 22845, "cut_index": 1331, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use PHPUnit\Framework\Attributes\DataProvider; class AuthenticatorTest extends AbstractWebTestCase { #[DataProvider('pro...
il.'"}', $client->getResponse()->getContent()); } else { $this->assertJsonStringEqualsJsonString('{"error":"Invalid credentials."}', $client->getResponse()->getContent()); } } #[DataProvider('provideEmails')] public
_provider.yml']); $client->request('GET', '/profile', [], [], [ 'HTTP_X-USER-EMAIL' => $email, ]); if ($withinFirewall) { $this->assertJsonStringEqualsJsonString('{"email":"'.$ema
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticatorTest.php", "language": "php", "file_size": 4290, "cut_index": 614, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Component\HttpKernel\KernelInterface...
ices'); $this->assertInstanceOf(AccessDecisionManager::class, $autowiredServices->getAccessDecisionManager(), 'The security.access.decision_manager service should be injected in debug mode'); static::bootKernel(['debug' => true]);
AbstractWebTestCase { public function testAccessDecisionManagerAutowiring() { static::bootKernel(['debug' => false]); $autowiredServices = static::getContainer()->get('test.autowiring_types.autowired_serv
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/AutowiringTypesTest.php", "language": "php", "file_size": 1514, "cut_index": 537, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Compone...
rf.token_storage')->setToken('foo', 'bar'); }); $form = $client->request('GET', '/login')->selectButton('login')->form(); $form['user_login[username]'] = 'johannes'; $form['user_login[password]'] = 'test'; $client->
unction testFormLoginAndLogoutWithCsrfTokens($options) { $client = $this->createClient($options); $this->callInRequestContext($client, static function () { static::getContainer()->get('security.cs
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php", "language": "php", "file_size": 5526, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Component\HttpFoundation\Request; us...
SecurityEvents; final class EventAliasTest extends AbstractWebTestCase { public function testAliasedEvents() { $client = $this->createClient(['test_case' => 'AliasedEvents', 'root_config' => 'config.yml']); $container = $client->ge
SuccessEvent; use Symfony\Component\Security\Core\User\InMemoryUser; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use Symfony\Component\Security\Http\Event\SwitchUserEvent; use Symfony\Component\Security\Http\
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/EventAliasTest.php", "language": "php", "file_size": 1935, "cut_index": 537, "middle_length": 229 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub; class Fi...
oot_config' => 'config_form_login.yml']); $client->request('GET', '/secure/resource'); $this->assertEquals( EntryPointStub::RESPONSE_TEXT, $client->getResponse()->getContent(), "Custom entry point wasn'
reateClient(['test_case' => 'FirewallEntryPoint', 'r
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/FirewallEntryPointTest.php", "language": "php", "file_size": 944, "cut_index": 606, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; class FormLoginTest extends AbstractWebTestCase { #[DataProvider('provideClientOptions')] public function testFormLogin(array $opti...
ing('Hello johannes!', $text); $this->assertStringContainsString('You\'re browsing to path "/profile".', $text); } #[DataProvider('provideClientOptions')] public function testFormLogout(array $options) { $client = $this->cr
$form['_password'] = 'test'; $client->submit($form); $this->assertRedirect($client->getResponse(), '/profile'); $text = $client->followRedirect()->text(null, true); $this->assertStringContainsStr
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php", "language": "php", "file_size": 5867, "cut_index": 716, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\H...
$kernel = self::createKernel(['test_case' => 'JsonLoginLdap', 'root_config' => 'config.yml']); $kernel->boot(); $this->assertInstanceOf(Kernel::class, $kernel); } public function testDefaultJsonLdapLoginSuccess() {
ny\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\QueryInterface; use Symfony\Component\Ldap\Entry; class JsonLoginLdapTest extends AbstractWebTestCase { public function testKernelBoot() {
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginLdapTest.php", "language": "php", "file_size": 2577, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Component\HttpFoundation\JsonResponse; class JsonLoginTest ex...
ss, $response); $this->assertSame(200, $response->getStatusCode()); $this->assertSame(['message' => 'Welcome @dunglas!'], json_decode($response->getContent(), true)); } public function testDefaultJsonLoginFailure() { $c
$client->request('POST', '/chk', [], [], ['CONTENT_TYPE' => 'application/json'], '{"user": {"login": "dunglas", "password": "foo"}}'); $response = $client->getResponse(); $this->assertInstanceOf(JsonResponse::cla
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php", "language": "php", "file_size": 2754, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attri...
$form['_username'] = 'johannes'; $form['_password'] = 'test'; $client->submit($form); $this->assertRedirect($client->getResponse(), '/'.$locale.'/profile'); $this->assertEquals('Profile', $client->followRedirect()->te
= $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'localized_routes.yml']); $crawler = $client->request('GET', '/'.$locale.'/login'); $form = $crawler->selectButton('login')->form();
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php", "language": "php", "file_size": 2748, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Psr\Container\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exc...
ces. * * @author Nicolas Grekas <p@tchwork.com> * * @internal */ class TestContainer extends Container { public function __construct( private KernelInterface $kernel, private string $privateServicesLocatorId, private array
d in tests. This gives access to both public and * private services. The container will not include private services that have * been inlined or removed. Private services will be removed when they are not * used by other servi
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php", "language": "php", "file_size": 4204, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFo...
bug' => true]); // we need an active request that is under the firewall to use the linker $request = Request::create('/get-login-link'); self::getContainer()->get(RequestStack::class)->push($request); /** @var LoginLinkHan
casts.com> */ class LoginLinkAuthenticationTest extends AbstractWebTestCase { public function testLoginLinkSuccess() { $client = $this->createClient(['test_case' => 'LoginLink', 'root_config' => 'config.yml', 'de
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/LoginLinkAuthenticationTest.php", "language": "php", "file_size": 2154, "cut_index": 563, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Component\BrowserKit\Cookie; use Symfony\Component\EventDispatc...
ent->disableReboot(); $client->request('POST', '/login', [ '_username' => 'johannes', '_password' => 'test', ]); $this->callInRequestContext($client, static function () { static::getContainer()-
st extends AbstractWebTestCase { public function testCsrfTokensAreClearedOnLogout() { $client = $this->createClient(['test_case' => 'LogoutWithoutSessionInvalidation', 'root_config' => 'config.yml']); $cli
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/LogoutTest.php", "language": "php", "file_size": 3617, "cut_index": 614, "middle_length": 229 }
MessageMiddleware; use Symfony\Component\Messenger\Middleware\RouterContextMiddleware; use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface; use Symfony\Component\Messenger\Transport\TransportFactoryInterface as MessengerTransportFactoryInterface; use Symfony\Component\Messenger\Transport\Transpo...
tifier\Notifier; use Symfony\Component\Notifier\Recipient\Recipient; use Symfony\Component\Notifier\TexterInterface; use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface; use Symfony\Component\ObjectMapper
fierBridge; use Symfony\Component\Notifier\Bridge\FakeChat\FakeChatTransportFactory; use Symfony\Component\Notifier\Bridge\FakeSms\FakeSmsTransportFactory; use Symfony\Component\Notifier\ChatterInterface; use Symfony\Component\No
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php", "language": "php", "file_size": 199469, "cut_index": 7068, "middle_length": 229 }
hp /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\C...
sDefinition('monolog.logger_prototype')) { return; } if (!$container->hasDefinition('debug.log_processor')) { return; } $container->getDefinition('monolog.logger_prototype') ->setConfigur
ProcessorPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('profiler')) { return; } if (!$container->ha
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddDebugLogProcessorPass.php", "language": "php", "file_size": 1085, "cut_index": 515, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\Config\ConfigCache; use Symfony\Compone...
loner; /** * Dumps the ContainerBuilder to a cache file so that it can be used by * debugging tools such as the debug:container console command. * * @author Ryan Weaver <ryan@thatsquality.com> * @author Fabien Potencier <fabien@symfony.com> */ class
; use Symfony\Component\DependencyInjection\Dumper\XmlDumper; use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\VarExporter\DeepC
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php", "language": "php", "file_size": 3040, "cut_index": 563, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Comp...
rn; } $definition = $container->getDefinition('debug.error_handler_configurator'); if ($container->hasDefinition('monolog.logger.php')) { $definition->replaceArgument(0, new Reference('monolog.logger.php')); }
class ErrorLoggerCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('debug.error_handler_configurator')) { retu
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ErrorLoggerCompilerPass.php", "language": "php", "file_size": 1181, "cut_index": 518, "middle_length": 229 }
peGenerator; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\PrototypedArrayNode; use Symfony\Component\Config\Loader\ParamConfigurator; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; u...
y\Component\Routing\Loader\Configurator\RoutesReference; /** * @internal */ class PhpConfigReferenceDumpPass implements CompilerPassInterface { private const REFERENCE_TEMPLATE = <<<'PHP' <?php // This file is auto-generated and is
ion\ExtensionInterface; use Symfony\Component\DependencyInjection\Kernel\BundleInterface; use Symfony\Component\DependencyInjection\Loader\Configurator\AppReference; use Symfony\Component\ExpressionLanguage\Expression; use Symfon
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/PhpConfigReferenceDumpPass.php", "language": "php", "file_size": 9321, "cut_index": 921, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Argument\ServiceClo...
sDefinition('test.private_services_locator')) { return; } $privateContainer = $container->getDefinition('test.private_services_locator'); $definitions = $container->getDefinitions(); $privateServices = $privateC
ference; /** * @author Nicolas Grekas <p@tchwork.com> */ class TestServiceContainerRealRefPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->ha
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerRealRefPass.php", "language": "php", "file_size": 2893, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPa...
Definition('test.private_services_locator')) { return; } $privateServices = []; $definitions = $container->getDefinitions(); foreach ($definitions as $id => $definition) { if ($inner = $definition->
erence; /** * @author Nicolas Grekas <p@tchwork.com> */ class TestServiceContainerWeakRefPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->has
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php", "language": "php", "file_size": 2440, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Find all service tags which are defined, but not used and yield a warnin...
_value_resolver', 'console.command', 'console.command.service_arguments', 'container.env_var_loader', 'container.env_var_processor', 'container.excluded', 'container.hot_path', 'container.no_preload',
'assets.package', 'auto_alias', 'cache.pool', 'cache.pool.clearer', 'cache.taggable', 'chatter.transport_factory', 'config_cache.resource_checker', 'console.argument
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php", "language": "php", "file_size": 5116, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\SecurityBundle; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSecurityVotersPass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compi...
\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterGlobalSecurityEventListenersPass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterLdapLocatorPass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterTok
akeFirewallsEventDispatcherTraceablePass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterCsrfFeaturesPass; use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterEntryPointPass; use Symfony
{ "filepath": "src/Symfony/Bundle/SecurityBundle/SecurityBundle.php", "language": "php", "file_size": 6837, "cut_index": 716, "middle_length": 229 }
allMap; use Symfony\Component\HttpFoundation\Cookie; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\DataCollector\DataCollector; use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; use Symfony\Component\Security\Core\A...
ace; use Symfony\Component\Security\Http\Firewall\SwitchUserListener; use Symfony\Component\Security\Http\FirewallMapInterface; use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator; use Symfony\Component\VarDumper\Caster\ClassStub; use Symfony\Com
agerInterface; use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager; use Symfony\Component\Security\Core\Authorization\Voter\TraceableVoter; use Symfony\Component\Security\Core\Role\RoleHierarchyInterf
{ "filepath": "src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php", "language": "php", "file_size": 13584, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; use Symfony\Component\Finder\Finder; class UnusedTagsPassUtils { public static function getDefinedTag...
if (preg_match_all('{<tag name="([^"]+)"}', $contents, $matches)) { foreach ($matches[1] as $match) { $tags[$match] = true; } } if (preg_match_all('{<argument type="tag
used in XML configs $files = Finder::create()->files()->name('*.xml')->path('Resources')->notPath('Tests')->in(\dirname(__DIR__, 5)); foreach ($files as $file) { $contents = file_get_contents($file);
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassUtils.php", "language": "php", "file_size": 3100, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use PHPUnit\Framework\Constraint\LogicalAnd; use PHPUnit\Framework\Constraint\LogicalNot; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\DomCrawler\Test\Constraint as DomCrawlerConstraint; use Symfony\Component\DomCrawler...
ction assertSelectorNotExists(string $selector, string $message = ''): void { self::assertThat(self::getCrawler(), new LogicalNot(new CrawlerSelectorExists($selector)), $message); } public static function assertSelectorCount(int $expec
rait { public static function assertSelectorExists(string $selector, string $message = ''): void { self::assertThat(self::getCrawler(), new CrawlerSelectorExists($selector), $message); } public static fun
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/DomCrawlerAssertionsTrait.php", "language": "php", "file_size": 6562, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Resource\SelfCheckingResourceChecker; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symf...
use NotificationAssertionsTrait; protected static ?string $class = null; protected static ?KernelInterface $kernel = null; protected static bool $booted = false; private static bool $kernelHasBeenRebooted = false; protected function
Case is the base class for tests needing a Kernel. * * @author Fabien Potencier <fabien@symfony.com> */ abstract class KernelTestCase extends TestCase { use ConsoleCommandAssertionsTrait; use MailerAssertionsTrait;
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php", "language": "php", "file_size": 6381, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use PHPUnit\Framework\Constraint\LogicalNot; use Symfony\Component\Mailer\Event\MessageEvent; use Symfony\Component\Mailer\Event\MessageEvents; use Symfony\Component\Mailer\Test\Constraint as MailerConstraint; use Symfony\Component\Mime\R...
ransport = null, string $message = ''): void { self::assertThat(self::getMessageMailerEvents(), new MailerConstraint\EmailCount($count, $transport, true), $message); } public static function assertEmailIsQueued(MessageEvent $event, str
g $message = ''): void { self::assertThat(self::getMessageMailerEvents(), new MailerConstraint\EmailCount($count, $transport), $message); } public static function assertQueuedEmailCount(int $count, ?string $t
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/MailerAssertionsTrait.php", "language": "php", "file_size": 5919, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfo...
* * @param array $options An array of options to pass to the createKernel method * @param array $server An array of server parameters */ protected static function createClient(array $options = [], array $server = []): KernelBrowse
t class WebTestCase extends KernelTestCase { use WebTestAssertionsTrait; protected function tearDown(): void { parent::tearDown(); self::getClient(null); } /** * Creates a KernelBrowser.
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php", "language": "php", "file_size": 1930, "cut_index": 537, "middle_length": 229 }
aultValue(['%env(default::SYMFONY_TRUSTED_PROXIES)%']) ->end() ->arrayNode('trusted_headers', 'trusted_header') ->performNoDeepMerging() ->beforeNormalization()->ifString()->then(static fn ($v) => $v ? [$v] : [])->end() ->protot...
$willBeAvailable = static function (string $package, string $class, ?string $parentPackage = null) { $parentPackages = (array) $parentPackage; $parentPackages[] = 'symfony/framework-bundle'; return ContainerBuilder
->defaultValue('error_controller') ->end() ->booleanNode('handle_all_throwables')->info('HttpKernel will handle all kinds of \Throwable.')->defaultTrue()->end() ->end() ;
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php", "language": "php", "file_size": 165478, "cut_index": 7068, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\...
reamer.stream_writer')) { return; } foreach ($container->findTaggedServiceIds('json_streamer.value_transformer', true) as $id => $_) { $definition = $container->getDefinition($id); if ($definition->hasTa
removed in Symfony 9.0 */ class DeprecateJsonStreamerValueTransformerTagPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('json_st
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/DeprecateJsonStreamerValueTransformerTagPass.php", "language": "php", "file_size": 1397, "cut_index": 524, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\...
rawler')) { return; } $metadata = []; foreach ($container->findTaggedServiceIds('json_path.function') as $tags) { foreach ($tags as $attributes) { if (!isset($attributes['name'])) {
and injects it into the json_path.crawler service. */ class JsonPathPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('json_path.c
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/JsonPathPass.php", "language": "php", "file_size": 1369, "cut_index": 524, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Comp...
e.command.translation_lint') || !$container->has('translator')) { return; } $translatorClass = $container->getParameterBag()->resolveValue($container->findDefinition('translator')->getClass()); if (!is_subclass_of($tra
racts\Translation\TranslatorInterface; final class TranslationLintCommandPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('consol
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationLintCommandPass.php", "language": "php", "file_size": 1212, "cut_index": 518, "middle_length": 229 }
tion\Exception\SessionNotFoundException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core...
rity\Core\User\UserInterface; use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\BadgeInterface; use Symfony\Component\Se
fony\Component\Security\Core\Authorization\UserAuthorizationCheckerInterface; use Symfony\Component\Security\Core\Exception\LogicException; use Symfony\Component\Security\Core\Exception\LogoutException; use Symfony\Component\Secu
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Security.php", "language": "php", "file_size": 11950, "cut_index": 921, "middle_length": 229 }
LogicalNot; use PHPUnit\Framework\ExpectationFailedException; use Symfony\Component\BrowserKit\AbstractBrowser; use Symfony\Component\BrowserKit\History; use Symfony\Component\BrowserKit\Request as BrowserKitRequest; use Symfony\Component\BrowserKit\Response as BrowserKitResponse; use Symfony\Component\BrowserKit\Test\...
public static function setBrowserKitAssertionsAsVerbose(bool $verbose): void { self::$defaultVerboseMode = $verbose; } public static function assertResponseIsSuccessful(string $message = '', ?bool $verbose = null): void { s
eConstraint; /** * Ideas borrowed from Laravel Dusk's assertions. * * @see https://laravel.com/docs/5.7/dusk#available-assertions */ trait BrowserKitAssertionsTrait { private static bool $defaultVerboseMode = true;
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/BrowserKitAssertionsTrait.php", "language": "php", "file_size": 11549, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Component\HttpClient\DataCollector\HttpClientDataCollector; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> */ trait HttpClientAssertionsTrait { public...
est. Please ensure to call "$client->enableProfiler()" before making the request.'); } /** @var HttpClientDataCollector $httpClientDataCollector */ $httpClientDataCollector = $profile->getCollector('http_client'); $expected
client'): void { /** @var KernelBrowser $client */ $client = static::getClient(); if (!($profile = $client->getProfile())) { static::fail('The Profiler must be enabled for the current requ
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/HttpClientAssertionsTrait.php", "language": "php", "file_size": 5329, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Component\DependencyInj...
} if (!$container->hasDefinition('router.request_context')) { $container->setParameter('asset.request_context.base_path', $container->getParameter('asset.request_context.base_path') ?? ''); $container->setParameter('asset
on\Reference; class AssetsContextPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('assets.context')) { return;
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AssetsContextPass.php", "language": "php", "file_size": 1681, "cut_index": 537, "middle_length": 229 }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfon...
>getParameterBag()->resolveValue($container->findDefinition('translation.writer')->getClass()); if (!method_exists($translationWriterClass, 'getFormats')) { $container->removeDefinition('console.command.translation_extract'); }
{ public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('console.command.translation_extract')) { return; } $translationWriterClass = $container-
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TranslationUpdateCommandPass.php", "language": "php", "file_size": 1006, "cut_index": 512, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; use PHPUnit\Framework\TestCas...
ster('bar') ->addTag('kenrel.event_subscriber'); $pass->process($container); $this->assertSame([\sprintf('%s: Tag "kenrel.event_subscriber" was defined on service(s) "foo", "bar", but was never used. Did you mean "kernel.event
public function testProcess() { $pass = new UnusedTagsPass(); $container = new ContainerBuilder(); $container->register('foo') ->addTag('kenrel.event_subscriber'); $container->regi
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/UnusedTagsPassTest.php", "language": "php", "file_size": 1928, "cut_index": 537, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection; use Symfony\Component\Dep...
n('debug.event_dispatcher')) { $container->getDefinition('debug.event_dispatcher')->replaceArgument(3, new Reference('request_stack', ContainerBuilder::NULL_ON_INVALID_REFERENCE)); } if ($container->hasDefinition('debug.log_pro
implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if ($container->has('.virtual_request_stack')) { return; } if ($container->hasDefinitio
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/VirtualRequestStackPass.php", "language": "php", "file_size": 1147, "cut_index": 518, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; use Symfony\Comp...
return; } $isMarshallerDecorated = false; foreach ($container->getDefinitions() as $definition) { $decorated = $definition->getDecoratedService(); if (null !== $decorated && 'session.marshaller' === $deco
RemoveUnusedSessionMarshallingHandlerPass implements CompilerPassInterface { public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('session.marshalling_handler')) {
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RemoveUnusedSessionMarshallingHandlerPass.php", "language": "php", "file_size": 1241, "cut_index": 518, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use PHPUnit\Framework\Constraint\LogicalNot; use Symfony\Component\Notifier\Event\MessageEvent; use Symfony\Component\Notifier\Event\Not...
nts(), new NotifierConstraint\NotificationCount($count, $transportName), $message); } public static function assertQueuedNotificationCount(int $count, ?string $transportName = null, string $message = ''): void { self::assertThat(self::
@gmail.com> */ trait NotificationAssertionsTrait { public static function assertNotificationCount(int $count, ?string $transportName = null, string $message = ''): void { self::assertThat(self::getNotificationEve
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php", "language": "php", "file_size": 4044, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\FrameworkBundle\Test; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Consol...
mmand arguments and options * @param string[] $interactiveInputs An array of strings representing each input passed to the command input stream * @param array<\Closure(string): string> $normalizers */ public static
Console\Tester\ExecutionResult; trait ConsoleCommandAssertionsTrait { /** * Runs a console command and returns the execution result. * * @param array $input An array of co
{ "filepath": "src/Symfony/Bundle/FrameworkBundle/Test/ConsoleCommandAssertionsTrait.php", "language": "php", "file_size": 3204, "cut_index": 614, "middle_length": 229 }
is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; use...
symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ return [ new FrameworkBundle(), new SecurityBundle(), new AutowiringBundle(), new TestBundle
Symfony package. * * (c) Fabien Potencier <fabien@
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AutowiringTypes/bundles.php", "language": "php", "file_size": 850, "cut_index": 535, "middle_length": 52 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\DependencyInjection; use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\...
nds Extension { public function load(array $configs, ContainerBuilder $container): void { $container ->register('localized_form_failure_handler', LocalizedFormFailureHandler::class) ->addArgument(new Reference('route
yInjection\Reference; class FormLoginExtension exte
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/DependencyInjection/FormLoginExtension.php", "language": "php", "file_size": 937, "cut_index": 606, "middle_length": 52 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AccessTokenBundle\Security\Http; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpF...
ticationFailureHandler implements AuthenticationFailureHandlerInterface { public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response { return new JsonResponse(['message' => 'Something went wrong'
enticationFailureHandlerInterface; class JsonAuthen
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AccessTokenBundle/Security/Http/JsonAuthenticationFailureHandler.php", "language": "php", "file_size": 931, "cut_index": 606, "middle_length": 52 }
n Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AccessTokenBundle\Security\Http; use Symfony\Component\HttpFoundation\JsonResponse; use...
terface; class JsonAuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface { public function onAuthenticationSuccess(Request $request, TokenInterface $token): ?Response { return new JsonResponse(['message' => \sprintf
y\Http\Authentication\AuthenticationSuccessHandlerIn
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AccessTokenBundle/Security/Http/JsonAuthenticationSuccessHandler.php", "language": "php", "file_size": 949, "cut_index": 582, "middle_length": 52 }
hp /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AccessTokenBundle\Sec...
UserBadge { return match ($accessToken) { 'VALID_ACCESS_TOKEN' => new UserBadge('dunglas'), 'SELF_CONTAINED_ACCESS_TOKEN' => new UserBadge('dunglas', static fn () => new InMemoryUser('dunglas', null, ['ROLE_USER'])),
cessTokenHandlerInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; class AccessTokenHandler implements AccessTokenHandlerInterface { public function getUserBadgeFrom(string $accessToken):
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AccessTokenBundle/Security/Handler/AccessTokenHandler.php", "language": "php", "file_size": 1098, "cut_index": 515, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RememberMeBundle\Security; use Symfony\Com...
{ // only reset the "internal db" for new tests if (self::$kernelClass !== $kernel::class) { self::$kernelClass = $kernel::class; self::$db = []; } } public function loadTokenBySeries(string $series)
re\Exception\TokenNotFoundException; class StaticTokenProvider implements TokenProviderInterface { private static array $db = []; private static ?string $kernelClass = null; public function __construct($kernel)
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/StaticTokenProvider.php", "language": "php", "file_size": 1938, "cut_index": 537, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RememberMeBundle\Security; use Symfony\Com...
UserProvider $inner) { $this->inner = $inner; } public function loadUserByUsername($username): UserInterface { return $this->changeUser($this->inner->loadUserByUsername($username)); } public function loadUserByIden
re\User\UserProviderInterface; class UserChangingUserProvider implements UserProviderInterface { private InMemoryUserProvider $inner; public static bool $changePassword = false; public function __construct(InMemory
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RememberMeBundle/Security/UserChangingUserProvider.php", "language": "php", "file_size": 1753, "cut_index": 537, "middle_length": 229 }
n Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RequestTrackerBundle\EventSubscriber; use Symfony\Component\EventDispatcher\EventSubscr...
function getSubscribedEvents(): array { return [ RequestEvent::class => 'onRequest', ]; } public function onRequest(RequestEvent $event) { $this->lastRequest = $event->getRequest(); } public fun
private ?Request $lastRequest; public static
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RequestTrackerBundle/EventSubscriber/RequestTrackerSubscriber.php", "language": "php", "file_size": 972, "cut_index": 582, "middle_length": 52 }
he Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RequestTrackerBundle\DependencyInjection; use Symfon...
ss RequestTrackerExtension extends Extension { public function load(array $configs, ContainerBuilder $container): void { $container->register('request_tracker_subscriber', RequestTrackerSubscriber::class) ->setPublic(true)
\DependencyInjection\Extension\Extension; final cla
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/RequestTrackerBundle/DependencyInjection/RequestTrackerExtension.php", "language": "php", "file_size": 907, "cut_index": 547, "middle_length": 52 }
\EventDispatcher\EventDispatcher; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Sym...
on\Voter\Vote; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; use Symfony\Component\Security\Core\Role\RoleHierarchy; use Symfony\Component\Security\Core\User\InMemoryUser; use Symfony\Component\Security\Http\Firewall\AbstractListe
oken\UsernamePasswordToken; use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager; use Symfony\Component\Security\Core\Authorization\Voter\TraceableVoter; use Symfony\Component\Security\Core\Authorizati
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php", "language": "php", "file_size": 19887, "cut_index": 1331, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Routing; use PHPUnit\Framework\TestCase; use Sy...
= new LogoutRouteLoader($logoutPaths, 'parameterName'); $collection = $loader(); self::assertInstanceOf(RouteCollection::class, $collection); self::assertCount(1, $collection); self::assertEquals(new Route('/logout'), $col
Routing\RouteCollection; class LogoutRouteLoaderTest extends TestCase { public function testLoad() { $logoutPaths = [ 'main' => '/logout', 'admin' => '/logout', ]; $loader
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Routing/LogoutRouteLoaderTest.php", "language": "php", "file_size": 1499, "cut_index": 524, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Fixtures; use Symfony\Component\HttpFoundation\...
class DummyAuthenticator implements AuthenticatorInterface { public function supports(Request $request): ?bool { return null; } public function authenticate(Request $request): Passport { } public function createToken(
eption; use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface; use Symfony\Component\Security\Http\Authenticator\Passport\Passport; use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Fixtures/DummyAuthenticator.php", "language": "php", "file_size": 1501, "cut_index": 524, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\LoginLink; use PHPUnit\Framework\TestCase; use Symfony\Bundle\SecurityBundle\LoginLink...
ny\Component\Security\Http\LoginLink\LoginLinkDetails; use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface; class FirewallAwareLoginLinkHandlerTest extends TestCase { public function testSuccessfulDecoration() { $user =
y\FirewallMap; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Security\Core\User\InMemoryUser; use Symfo
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/LoginLink/FirewallAwareLoginLinkHandlerTest.php", "language": "php", "file_size": 2585, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\CacheWarmer; use PHPUnit\Framework\TestCase; use Symfony\Bun...
[$expressions[0], ['token', 'user', 'object', 'subject', 'role_names', 'request', 'trust_resolver']], [$expressions[1], ['token', 'user', 'object', 'subject', 'role_names', 'request', 'trust_resolver']], ]; $expressionLan
rity\Core\Authorization\ExpressionLanguage; class ExpressionCacheWarmerTest extends TestCase { public function testWarmUp() { $expressions = [new Expression('A'), new Expression('B')]; $series = [
{ "filepath": "src/Symfony/Bundle/SecurityBundle/Tests/CacheWarmer/ExpressionCacheWarmerTest.php", "language": "php", "file_size": 1648, "cut_index": 537, "middle_length": 229 }