prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
<?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\Tests\Functional\Bundle\TestBundle\Depend... | {
$this->customConfig = $customConfig;
}
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('test');
$this->customConfig?->addConfiguration($treeBuilder->getRootNode());
ret | Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
private ?CustomConfig $customConfig;
public function __construct(?CustomConfig $customConfig = null)
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/Configuration.php",
"language": "php",
"file_size": 1023,
"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\Functional\Bundle\TestBundle\DependencyInjection;
use Symfo... | pendExtensionInterface
{
private ?CustomConfig $customConfig = null;
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = $this->getConfiguration($configs, $container);
$this->processConfig | ndencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
class TestExtension extends Extension implements Pre | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/TestExtension.php",
"language": "php",
"file_size": 1516,
"cut_index": 537,
"middle_length": 229
} |
s 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\Functional\Bundle\TestBundle\DependencyInjection\Config;
c... | ->children()
->scalarNode('child1')->end()
->scalarNode('child2')->end()
->end()
->end()
->end()
->end()
;
}
} | array')
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/DependencyInjection/Config/CustomConfig.php",
"language": "php",
"file_size": 807,
"cut_index": 536,
"middle_length": 14
} |
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\DataCollector;
use Symfony\Bundle\FrameworkBundle\Controller\RedirectController;
use ... | NoRouteAtrribute()
{
$collector = new RouterDataCollector();
$request = Request::create('http://test.com/foo?bar=baz');
$response = new RedirectResponse('http://test.com/redirect');
$event = $this->createControllerEven | t\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\KernelInterface;
class RouterDataCollectorTest extends TestCase
{
public function testRouteRedirectController | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DataCollector/RouterDataCollectorTest.php",
"language": "php",
"file_size": 2319,
"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\Tests\Routing;
use PHPUnit\Framework\TestCase;
use S... |
$collection = $loader->load(InvokableController::class);
$route = $collection->get('lol');
$this->assertSame(InvokableController::class, $route->getDefault('_controller'));
}
public function testConfigureRouteSetsControll | uting\Fixtures\MethodActionControllers;
class AttributeRouteControllerLoaderTest extends TestCase
{
public function testConfigureRouteSetsControllerForInvokable()
{
$loader = new AttributeRouteControllerLoader(); | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Routing/AttributeRouteControllerLoaderTest.php",
"language": "php",
"file_size": 1448,
"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\FrameworkBundle\Tests\Routing;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Routing\D... | egatingLoader(new LoaderResolver());
$this->assertTrue(true, '__construct() takes a LoaderResolverInterface as its first argument.');
}
public function testLoadDefaultOptions()
{
$loaderResolver = $this->createMock(LoaderResolv | ny\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouteCompiler;
class DelegatingLoaderTest extends TestCase
{
public function testConstructorApi()
{
new Del | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Routing/DelegatingLoaderTest.php",
"language": "php",
"file_size": 2447,
"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\Routing;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Routing\R... | te('/foo/'));
$matcher = $this->getMatcher($routes, $context = new RequestContext());
$this->assertEquals(
[
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
| fony\Component\Routing\RouteCollection;
class RedirectableCompiledUrlMatcherTest extends TestCase
{
public function testRedirectWhenNoSlash()
{
$routes = new RouteCollection();
$routes->add('foo', new Rou | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RedirectableCompiledUrlMatcherTest.php",
"language": "php",
"file_size": 2422,
"cut_index": 563,
"middle_length": 229
} |
metersResourceChecker;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBag;
use Symfony\Component\Dep... | ny\Component\DependencyInjection\ContainerInterface" instance or provide the $parameters argument of the "Symfony\Bundle\FrameworkBundle\Routing\Router::__construct" method');
new Router($this->createStub(ContainerInterface::class), 'foo');
}
| erTest extends TestCase
{
public function testConstructThrowsOnNonSymfonyNorPsr11Container()
{
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('You should either pass a "Symfo | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php",
"language": "php",
"file_size": 20726,
"cut_index": 1331,
"middle_length": 229
} |
\MockObject\MockObject;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\EventListener\SuggestMissingPackageSubscriber;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Event\ConsoleErrorEvent;
use S... | ntDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\KernelInterface;
class | er\ApplicationTester;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\Eve | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php",
"language": "php",
"file_size": 11346,
"cut_index": 921,
"middle_length": 229
} |
PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\FooUnitEnum;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\Depend... | ): void
{
$this->colSize = getenv('COLUMNS');
putenv('COLUMNS=121');
}
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
#[DataProvider('getDescribeRout | \EventDispatcher;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
abstract class AbstractDescriptorTestCase extends TestCase
{
private string|false $colSize;
protected function setUp( | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTestCase.php",
"language": "php",
"file_size": 14471,
"cut_index": 921,
"middle_length": 229
} |
\Fixtures\Suit;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use... | tion();
foreach (self::getRoutes() as $name => $route) {
$collection1->add($name, $route);
}
$routesWithGenericHost = new RouteCollection();
$routesWithGenericHost->add('some_route', new RouteStub(
' | ent\Routing\CompiledRoute;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
class ObjectsProvider
{
public static function getRouteCollections()
{
$collection1 = new RouteCollec | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php",
"language": "php",
"file_size": 13493,
"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\Tests\Console\Descriptor;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Bundle... | static function getFormat()
{
return 'txt';
}
public static function getDescribeRouteWithControllerLinkTestData()
{
$getDescribeData = static::getDescribeRouteTestData();
foreach ($getDescribeData as $key => &$dat | bstractDescriptorTestCase
{
private static ?FileLinkFormatter $fileLinkFormatter = null;
protected static function getDescriptor()
{
return new TextDescriptor(static::$fileLinkFormatter);
}
protected | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/TextDescriptorTest.php",
"language": "php",
"file_size": 2378,
"cut_index": 563,
"middle_length": 229
} |
er\ParamConfigurator as Param;
/**
* This class provides array-shapes for configuring the services and bundles of an application.
*
* Services declared with the config() method below are autowired and autoconfigured by default.
*
* This is for apps only. Bundles SHOULD NOT use it.
*
* Example:
*
* ```php
... | l,
* }>
* @psalm-type ParametersConfig = array<string, scalar|\UnitEnum|array<scalar|\UnitEnum|array<mixed>|Param|null>|Param|null>
* @psalm-type ArgumentsType = list<mixed>|array<string, mixed>
* @psalm-type CallType = array<string, ArgumentsType>|arr | * 'resource' => '../src/',
* ],
* ],
* ]);
* ```
*
* @psalm-type ImportsConfig = list<string|array{
* resource: string,
* type?: string|null,
* ignore_errors?: boo | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/reference.php",
"language": "php",
"file_size": 8277,
"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\Fixtures\Console;
use Symfony\Component\Console\Attribute\A... | owire] with service reference
#[Autowire(service: 'Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Console\TestService')]
TestService $autowiredService,
// Test #[Autowire] with parameter
#[Autowire('%kernel.environment%')]
| yInjection\Attribute\Autowire;
use Symfony\Component\DependencyInjection\Attribute\Target;
#[AsCommand('app:advanced')]
class AdvancedCommand
{
public function __invoke(
OutputInterface $output,
// Test #[Aut | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/AdvancedCommand.php",
"language": "php",
"file_size": 1656,
"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\FrameworkBundle\Tests\Fixtures\Console;
use Symfony\Component\Console\ArgumentResolver\ValueResolver\ValueResolverInterface;
use Symfony\Component\Con... | ion resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable
{
if ('autoTagged' === $argumentName && 'string' === $member->getType()?->getName()) {
return ['auto-tagged-value'];
}
ret | implements ValueResolverInterface
{
public funct | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/AutoTaggedValueResolver.php",
"language": "php",
"file_size": 930,
"cut_index": 606,
"middle_length": 52
} |
?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\Tests\Fixtures\Console;
use Symfony\Compo... | ('customOption' !== $argumentName || !$type instanceof \ReflectionNamedType || CustomType::class !== $type->getName()) {
return [];
}
$value = $input->hasOption('format') ? $input->getOption('format') : 'default';
yiel | ass CustomOptionValueResolver implements ValueResolverInterface
{
public function resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable
{
$type = $member->getType();
if | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/CustomOptionValueResolver.php",
"language": "php",
"file_size": 1044,
"cut_index": 513,
"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\Fixtures\Console;
use Symfony\Component\Console\Attribute\A... | nterface $output,
#[ValueResolver(CustomTypeValueResolver::class)] CustomType $custom,
#[Argument] string $name,
TestService $service,
#[ValueResolver(CustomOptionValueResolver::class)] CustomType $customOption,
#[Ar | \Command\Command;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'app:custom-type', description: 'Tests custom argument resolver')]
class CustomTypeCommand
{
public function __invoke(
OutputI | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/CustomTypeCommand.php",
"language": "php",
"file_size": 1699,
"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\Tests\Fixtures\Console;
use Symfony\Comp... | !$type instanceof \ReflectionNamedType || CustomType::class !== $type->getName()) {
return [];
}
$name = $input->hasArgument('name') ? $input->getArgument('name') : 'default';
yield new CustomType('resolved:' . $name); | lass CustomTypeValueResolver implements ValueResolverInterface
{
public function resolve(string $argumentName, InputInterface $input, ReflectionMember $member): iterable
{
$type = $member->getType();
if ( | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/CustomTypeValueResolver.php",
"language": "php",
"file_size": 1006,
"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\FrameworkBundle\Tests\Fixtures\Console;
use Symfony\Component\... | utInterface $output,
#[Argument] string $scenario,
string $autoTagged = '',
#[ValueResolver('targeted')] ?CustomType $targeted = null,
): int {
if ('auto-tagged' === $scenario) {
$output->writeln('Auto-tagged | \Component\Console\Output\OutputInterface;
/**
* Tests both auto-tagged and targeted value resolver autoconfiguration.
*/
#[AsCommand('app:resolver-test')]
class ResolverTestCommand
{
public function __invoke(
Outp | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/ResolverTestCommand.php",
"language": "php",
"file_size": 1193,
"cut_index": 518,
"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\Tests\Fixtures\Console;
use Symfony\Comp... | InputInterface $input, ReflectionMember $member): iterable
{
if ('targeted' === $argumentName && CustomType::class === $member->getType()?->getName()) {
return [new CustomType('targeted-value')];
}
return [];
}
| ionMember;
use Symfony\Component\Console\Input\InputInterface;
#[AsTargetedValueResolver('targeted')]
final class TargetedCustomValueResolver implements ValueResolverInterface
{
public function resolve(string $argumentName, | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/TargetedCustomValueResolver.php",
"language": "php",
"file_size": 999,
"cut_index": 512,
"middle_length": 229
} |
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\FrameworkBundle\Tests\Fixtures\Console;
use Symfony\Component\Console\Attribute\AsCommand;
... | idatedInputCommand
{
public function __invoke(
OutputInterface $output,
#[MapInput]
ValidatedInput $input,
): int {
$output->writeln('Name: '.$input->name);
$output->writeln('Email: '.$input->email);
| description: 'Tests validated MapInput')]
class Val | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Console/ValidatedInputCommand.php",
"language": "php",
"file_size": 889,
"cut_index": 547,
"middle_length": 52
} |
e is used for translation message extraction tests
<?php echo $view['translator']->trans('single-quoted key') ?>
<?php echo $view['translator']->trans('double-quoted key') ?>
<?php echo $view['translator']->trans(<<<'EOF'
heredoc key
EOF
) ?>
<?php echo $view['translator']->trans(<<<'EOF'
nowdoc key
EOF
) ?>
<?php echo... | sequences
EOF
) ?>
<?php echo $view['translator']->trans('single-quoted key with "quote mark at the end"') ?>
<?php echo $view['translator']->trans('other-domain-test-no-params-short-array', [], 'not_messages'); ?>
<?php echo $view['translator']->trans | ped \$\n\' sequences'
) ?>
<?php echo $view['translator']->trans(<<<EOF
heredoc key with whitespace and escaped \$\n sequences
EOF
) ?>
<?php echo $view['translator']->trans(<<<'EOF'
nowdoc key with whitespace and nonescaped \$\n | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php",
"language": "php",
"file_size": 1402,
"cut_index": 524,
"middle_length": 229
} |
er;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Scheduler\Attribute\AsCronTask;
#[AsC... | ray $calls = [];
public function configure(): void
{
$this->addArgument('dummy-argument', InputArgument::OPTIONAL);
}
public function execute(InputInterface $input, ?OutputInterface $output = null): int
{
self::$calls[ | DummyCommand extends Command
{
public static ar | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Messenger/DummyCommand.php",
"language": "php",
"file_size": 989,
"cut_index": 582,
"middle_length": 52
} |
Bundle\FrameworkBundle\Tests\Fixtures\Messenger;
use Symfony\Component\Scheduler\Attribute\AsCronTask;
use Symfony\Component\Scheduler\Attribute\AsPeriodicTask;
#[AsCronTask(expression: '* * * * *', arguments: [1], schedule: 'dummy_task')]
#[AsCronTask(expression: '0 * * * *', timezone: 'Europe/Berlin', arguments: ['... | day', from: '2023-10-25 09:59:00Z', arguments: ['9b'], schedule: 'dummy_task', method: 'method5')]
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', arguments: ['named' => '9'], schedule: 'dummy_task', method: 'method5')]
class DummyTask
| er: 60, arguments: ['4'], schedule: 'dummy_task', method: 'method4')]
#[AsPeriodicTask(frequency: '1 day', from: '2023-10-25 09:59:00Z', arguments: ['9'], schedule: 'dummy_task', method: 'method5')]
#[AsPeriodicTask(frequency: '1 | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Messenger/DummyTask.php",
"language": "php",
"file_size": 1557,
"cut_index": 537,
"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\NullLogger;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernel... | or\RoutingConfigurator;
class ConcreteMicroKernel extends Kernel implements EventSubscriberInterface
{
use MicroKernelTrait {
getKernelParameters as public;
}
private string $cacheDir;
public function onKernelException(ExceptionE | ony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Loader\Configurat | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php",
"language": "php",
"file_size": 2814,
"cut_index": 563,
"middle_length": 229
} |
\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use... | \Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
require_once __DIR__.'/default/src/DefaultKernel.php';
require_once __DIR__.'/flex-style/src/FlexStyleMicroKernel.php';
class MicroKernelTraitTest extend | or\ContainerConfigurator;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/MicroKernelTraitTest.php",
"language": "php",
"file_size": 11944,
"cut_index": 921,
"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\Tests\Kernel;
use Symfony\Bundle\FrameworkBundle... | __construct('test', false);
$this->cacheDir = sys_get_temp_dir().'/'.$cacheDir;
}
public function getCacheDir(): string
{
return $this->cacheDir;
}
public function getLogDir(): string
{
return $this->cache | __construct(string $cacheDir)
{
parent:: | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/MinimalKernel.php",
"language": "php",
"file_size": 841,
"cut_index": 520,
"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\Bundle\FrameworkBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundl... | $this->application = new Application($kernel);
}
public function testDumpAllTrans()
{
$tester = $this->createCommandTester();
$ret = $tester->execute(['locale' => 'en']);
$this->assertSame(
TranslationDeb | mandTest extends AbstractWebTestCase
{
private Application $application;
protected function setUp(): void
{
$kernel = static::createKernel(['test_case' => 'TransDebug', 'root_config' => 'config.yml']);
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TranslationDebugCommandTest.php",
"language": "php",
"file_size": 2251,
"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\Tests\Functional\Extension;
use Symfony\Compon... | );
$treeBuilder->getRootNode()
->children()
->booleanNode('enabled')->defaultTrue()->end()
->end()
;
return $treeBuilder;
}
public function load(array $configs, ContainerBuilder $con | endencyInjection\Extension\Extension;
class TestDumpExtension extends Extension implements ConfigurationInterface
{
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('test_dump' | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Extension/TestDumpExtension.php",
"language": "php",
"file_size": 1171,
"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\Tests\Functional\app;
use Psr\Log\NullLogger;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Extension\TestDumpExtension;
use Symfony\Com... | ests.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class AppKernel extends Kernel implements ExtensionInterface, ConfigurationInterface
{
private string $varDir;
private string $testCase;
private string $rootConfig;
public | ncyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
/**
* App Test Kernel for functional t | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php",
"language": "php",
"file_size": 4657,
"cut_index": 614,
"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\Tests\Functional\app\JsonStreamer;
use Symfony\Compo... | {
public function transform(mixed $value, array $options = []): string
{
return $value[0].'..'.$value[1];
}
public static function getStreamValueType(): BuiltinType
{
return Type::string( | \Component\TypeInfo\Type\BuiltinType;
// BC layer for "symfony/json-streamer" < 8.1
if (!interface_exists(PropertyValueTransformerInterface::class)) {
class RangeToStringValueTransformer implements ValueTransformerInterface
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/JsonStreamer/RangeToStringValueTransformer.php",
"language": "php",
"file_size": 1399,
"cut_index": 524,
"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\FrameworkBundle\Tests\Functional\Bundle\DefaultConfigTestBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use ... | $treeBuilder->getRootNode()
->children()
->scalarNode('foo')->defaultValue('%default_config_test_foo%')->end()
->scalarNode('baz')->defaultValue('%env(BAZ)%')->end()
->end();
return $t | Builder = new TreeBuilder('default_config_test');
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/DefaultConfigTestBundle/DependencyInjection/Configuration.php",
"language": "php",
"file_size": 934,
"cut_index": 606,
"middle_length": 52
} |
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\Bundle\FrameworkBundle\Tests\Functional\Bundle\DefaultConfigTestBundle\DependencyInjection;
use Symfony\Compon... | $configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('default_config_test', $config['foo']);
$container->setParameter('default_config_test', $config['b | onfigs, ContainerBuilder $container): void
{
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/DefaultConfigTestBundle/DependencyInjection/DefaultConfigTestExtension.php",
"language": "php",
"file_size": 882,
"cut_index": 559,
"middle_length": 52
} |
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\Tests\Functional\Bundle\TestBundle;
use Symfony\Bund... | lass TestBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
/** @var DependencyInjection\TestExtension $extension */
$extension = $container->getExtension('test');
| nt\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
use Symfony\Component\HttpKernel\Bundle\Bundle;
c | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/TestBundle.php",
"language": "php",
"file_size": 1498,
"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\Tests\Functional\Bundle\TestBundle\AutowiringT... | herInterface $dispatcher,
private readonly CacheItemPoolInterface $cachePool,
) {
}
public function getDispatcher()
{
return $this->dispatcher;
}
public function getCachePool()
{
return $this->cachePool | y EventDispatc | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/AutowiringTypes/AutowiredServices.php",
"language": "php",
"file_size": 797,
"cut_index": 517,
"middle_length": 14
} |
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\Tests\Functional\Bundle\TestBundle\Controller;
use S... | e@symfony.com')
->addCc('cc@symfony.com')
->text('Bar!')
->html('<p>Foo</p>')
->addPart(new DataPart(file_get_contents(__FILE__), 'foobar.php'))
);
$mailer->send((new Email())->to('fabien@sym | taPart;
class EmailController
{
public function indexAction(MailerInterface $mailer)
{
$mailer->send((new Email())->to('fabien@symfony.com')->from('fabien@symfony.com')->subject('Foo')
->addReplyTo('m | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/EmailController.php",
"language": "php",
"file_size": 1390,
"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\Tests\Functional\Bundle\TestBundle\Controller;
... | o']);
$symfonyHttpClient->request('POST', '/', ['body' => ['foo' => 'bar']]);
$symfonyHttpClient->request('POST', '/', ['json' => ['foo' => 'bar']]);
$symfonyHttpClient->request('POST', '/', [
'headers' => ['X-Test-Heade | ttpClientInterface $symfonyHttpClient): Response
{
$httpClient->request('GET', 'https://symfony.com/');
$symfonyHttpClient->request('GET', '/');
$symfonyHttpClient->request('POST', '/', ['body' => 'fo | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/HttpClientController.php",
"language": "php",
"file_size": 1180,
"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\Tests\Functional\Bundle\TestBundle\Controller;
use S... | ('Symfony is awesome!');
$notifier->send($firstNotification);
$secondNotification = (new Notification('New urgent notification'))
->importance(Notification::IMPORTANCE_URGENT)
;
$notifier->send($secondNotificati | ecipient;
final class NotificationController
{
public function indexAction(NotifierInterface $notifier)
{
$firstNotification = new Notification('Hello World!', ['chat/slack']);
$firstNotification->content | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/NotificationController.php",
"language": "php",
"file_size": 1258,
"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\Tests\Functional;
use PHPUnit\Framework\Attributes\G... | nd('list');
$this->assertInstanceOf(ExecutionResult::class, $result);
$this->assertSame(Command::SUCCESS, $result->statusCode);
$this->assertStringContainsString('Available commands:', $result->getOutput());
}
public funct | ted function setUp(): void
{
static::bootKernel(['test_case' => 'RunCommand', 'root_config' => 'config.yml']);
}
public function testRunCommandReturnsExecutionResult()
{
$result = static::runComma | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RunCommandTest.php",
"language": "php",
"file_size": 1415,
"cut_index": 524,
"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\Functional;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\TranslatableBackedEnum;
use Symfony\Bundle\FrameworkBundle\Tests\Functiona... | erializer.alias')->deserialize('{"bars": [{"id": 1}, {"id": 2}]}', Foo::class, 'json');
$bar1 = new Bar();
$bar1->id = 1;
$bar2 = new Bar();
$bar2->id = 2;
$expected = new Foo();
$expected->bars = [$bar1, $ | ail.com>
*/
class SerializerTest extends AbstractWebTestCase
{
public function testDeserializeArrayOfObject()
{
static::bootKernel(['test_case' => 'Serializer']);
$result = static::getContainer()->get('s | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SerializerTest.php",
"language": "php",
"file_size": 3725,
"cut_index": 614,
"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\FrameworkBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhpExtensio... | testLocalizedSlugger()
{
$kernel = static::createKernel(['test_case' => 'Slugger', 'root_config' => 'config.yml']);
$kernel->boot();
$service = $kernel->getContainer()->get(SlugConstructArgService::class);
$this->asse | #[RequiresPhpExtension('intl')]
public function | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SluggerLocaleAwareTest.php",
"language": "php",
"file_size": 961,
"cut_index": 582,
"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\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
use Symfony\Component\DependencyInjection\Co... | fr', '_format' => 'json']);
$altUrl = $this->generateUrl('subrequest_fragment', ['_locale' => 'fr', '_format' => 'json']);
// simulates a failure during the rendering of a fragment...
// should render fr/json
$content = $ha | tController
{
public function __construct(private ContainerInterface $container)
{
}
public function indexAction($handler)
{
$errorUrl = $this->generateUrl('subrequest_fragment_error', ['_locale' => ' | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php",
"language": "php",
"file_size": 2377,
"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\Tests\Functional;
use PHPStan\PhpDocParser\Parser\Ph... | eflectionProperty(Dummy::class, 'name')));
if (!class_exists(PhpDocParser::class)) {
$this->markTestSkipped('"phpstan/phpdoc-parser" dependency is required.');
}
$this->assertEquals(Type::int(), static::getContainer()- | stractWebTestCase
{
public function testComponent()
{
static::bootKernel(['test_case' => 'TypeInfo']);
$this->assertEquals(Type::string(), static::getContainer()->get('type_info.resolver')->resolve(new \R | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/TypeInfoTest.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\Tests\Functional\app\JsonStreamer;
use Symfony... | n $object->value.' '.$object->unit;
}
public function reverseTransform(int|float|string|bool|null $scalar, array $options = []): object
{
return new Height(...explode(' ', $scalar));
}
public static function getStreamValueType | ormerInterface<Height, string>
*/
class HeightValueObjectTransformer implements ValueObjectTransformerInterface
{
public function transform(object $object, array $options = []): int|float|string|bool|null
{
retur | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/JsonStreamer/HeightValueObjectTransformer.php",
"language": "php",
"file_size": 1168,
"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\Tests\Functional\app\JsonStreamer;
use Symfony\Compo... | {
public function transform(mixed $value, array $options = []): array
{
return array_map(static fn (string $v): int => (int) $v, explode('..', $value));
}
public static function getStreamValueType(): Builtin | \Component\TypeInfo\Type\BuiltinType;
// BC layer for "symfony/json-streamer" < 8.1
if (!interface_exists(PropertyValueTransformerInterface::class)) {
class StringToRangeValueTransformer implements ValueTransformerInterface
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/JsonStreamer/StringToRangeValueTransformer.php",
"language": "php",
"file_size": 1493,
"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\FrameworkBundle\Tests\Functional\Bundle\RoutingConditionServiceBundle\Controller;
use Symfony\Component\Htt... | .flip(false)',
)]
public function allowedByAutoConfigured(): Response
{
return new Response();
}
#[Route(
path: '/allowed/auto-configured-non-aliased',
condition: 'service("auto_configured_non_aliased").alwaysTr | ged").giveMeTrue()',
)]
public function allowedByManuallyTagged(): Response
{
return new Response();
}
#[Route(
path: '/allowed/auto-configured',
condition: 'service("auto_configured") | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/RoutingConditionServiceBundle/Controller/DefaultController.php",
"language": "php",
"file_size": 2078,
"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\Functional\Bundle\TestBundle\Controller;
use Symfony\Compon... | blic function argumentDefaultNullWithoutRouteParamAction($value = null): Response
{
return new Response($value);
}
#[Route('/null_argument_with_route_param/{value}', name: 'null_argument_with_route_param')]
public function argument | request')]
public function requestDefaultNullAction(?Request $request = null): Response
{
return new Response($request ? $request::class : null);
}
#[Route('/null_argument', name: 'null_argument')]
pu | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/AnnotatedController.php",
"language": "php",
"file_size": 1543,
"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\Tests\Functional\Bundle\TestBundle\Controller;
... | his->container = $container;
}
public function profileAction()
{
return new Response('Welcome '.$this->container->get('security.token_storage')->getToken()->getUserIdentifier().'!');
}
public static function getSubscribedServi | cts\Service\ServiceSubscriberInterface;
class SecurityController implements ServiceSubscriberInterface
{
private ContainerInterface $container;
public function __construct(ContainerInterface $container)
{
$t | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SecurityController.php",
"language": "php",
"file_size": 1128,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Security\Core\User\UserInterface;
class SecurityTest extends AbstractWebTestCase
{
#[DataProvider... | wallContext);
}
$client->request('GET', '/'.($firewallContext ?? 'main').'/user_profile');
$this->assertEquals('Welcome '.$username.'!', $client->getResponse()->getContent());
}
public static function getUsers()
{
| ient = $this->createClient(['test_case' => 'Security', 'root_config' => 'config.yml']);
if (null === $firewallContext) {
$client->loginUser($user);
} else {
$client->loginUser($user, $fire | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SecurityTest.php",
"language": "php",
"file_size": 5760,
"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\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
use Symfony\Component\DependencyInjection\Co... | e
if (!$session->has('name')) {
if (!$name) {
return new Response('<html><body>You are new here and gave no name.</body></html>');
}
// remember name
$session->set('name', $name);
|
public function __construct(protected ContainerInterface $container)
{
}
public function welcomeAction(Request $request, $name = null)
{
$session = $request->getSession();
// new session cas | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php",
"language": "php",
"file_size": 2350,
"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\Tests\Functional;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\UuidV1;
use Symfony\Component\Uid\UuidV4;
use Symfony\Component\Ui... | onMessage('Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\UidController::anyFormat(): Argument #1 ($userId) must be of type Symfony\Component\Uid\UuidV1, string given');
$client->request('GET', '/1/uuid-v1/'.new UuidV | {
$client = $this->createClient(['test_case' => 'Uid', 'root_config' => 'config_disabled.yml']);
$client->catchExceptions(false);
$this->expectException(\TypeError::class);
$this->expectExcepti | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/UidTest.php",
"language": "php",
"file_size": 3570,
"cut_index": 614,
"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\Tests\Functional\app\JsonStreamer\Dto;
use Sym... | mer\Attribute\ValueTransformer;
#[JsonStreamable]
class Dummy
{
#[StreamedName('@name')]
#[ValueTransformer(
nativeToStream: 'strtoupper',
streamToNative: 'strtolower',
)]
public string $name = 'dummy';
#[ValueTransfor | meworkBundle\Tests\Functional\app\JsonStreamer\StringToRangeValueTransformer;
use Symfony\Component\JsonStreamer\Attribute\JsonStreamable;
use Symfony\Component\JsonStreamer\Attribute\StreamedName;
use Symfony\Component\JsonStrea | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/JsonStreamer/Dto/Dummy.php",
"language": "php",
"file_size": 1219,
"cut_index": 518,
"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\Tests\Functional\Bundle\TestBundle\EnvVarLoa... | r implements EnvVarLoaderInterface
{
private static array $envVars = [];
public static function setEnvVar(string $name, string $value): void
{
self::$envVars[$name] = $value;
}
public static function reset(): void
{
| ol what the loader returns and to verify
* that the running container's already-initialized processor (with its cached
* env var state) is used by ConfigDebugCommand instead of a freshly-built one.
*/
class StatefulEnvVarLoade | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/EnvVarLoader/StatefulEnvVarLoader.php",
"language": "php",
"file_size": 1116,
"cut_index": 515,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\BarMessage;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyCommand;
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummySchedule;
use S... | duler\RecurringMessage;
class SchedulerTest extends AbstractWebTestCase
{
public function testScheduler()
{
$scheduledMessages = [
RecurringMessage::every('5 minutes', $foo = new FooMessage(), new \DateTimeImmutable('2020-01-01 | ponent\HttpKernel\KernelInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
use Symfony\Component\Scheduler\Messenger\SchedulerTransport;
use Symfony\Component\Sche | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SchedulerTest.php",
"language": "php",
"file_size": 5431,
"cut_index": 716,
"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\Tests\Functional\Bundle\ExtensionWithoutConf... | public function getNamespace(): string
{
return '';
}
/**
* To be removed when symfony/dependency-injection is bumped to 8.0+.
*/
public function getXsdValidationBasePath(): string|false
{
return false;
| nfigTestExtension implements ExtensionInterface
{
public function load(array $configs, ContainerBuilder $container): void
{
}
/**
* To be removed when symfony/dependency-injection is bumped to 8.0+.
*/
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/ExtensionWithoutConfigTestBundle/DependencyInjection/ExtensionWithoutConfigTestExtension.php",
"language": "php",
"file_size": 1106,
"cut_index": 515,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\DataProvider;
class SessionTest extends AbstractWebTestCase
{
/**
* Tests session attributes persist.
*/
#[DataProvider('getConfigs')]
public function testWelcome($config... | GET', '/session/drak');
$this->assertStringContainsString('Hello drak, nice to meet you.', $crawler->text());
// prove remembered name
$crawler = $client->request('GET', '/session');
$this->assertStringContainsString('Welco | no session
$crawler = $client->request('GET', '/session');
$this->assertStringContainsString('You are new here and gave no name.', $crawler->text());
// remember name
$crawler = $client->request(' | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SessionTest.php",
"language": "php",
"file_size": 6033,
"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\Functional\Bundle\TestBundle\Controller;
use Symfony\Compon... | blic function inlinedAction($options, $_format)
{
return new Response($options['bar']->getBar().' '.$_format);
}
public function customFormatAction($_format)
{
return new Response($_format);
}
public function custo | iGeneratorInterface;
use Twig\Environment;
class FragmentController
{
public function indexAction(Environment $twig)
{
return new Response($twig->render('fragment.html.twig', ['bar' => new Bar()]));
}
pu | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php",
"language": "php",
"file_size": 1608,
"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 Symfony\Bundle\FrameworkBundle\Command\CachePoolInvalidateTagsCommand;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
u... | is->createCommand(['foo' => null, 'bar' => null]));
$suggestions = $tester->complete(['--pool=']);
$this->assertSame(['foo', 'bar'], $suggestions);
}
public function testInvalidatesTagsForAllPoolsByDefault()
{
$tagsTo | Injection\ServiceLocator;
use Symfony\Contracts\Cache\TagAwareCacheInterface;
class CachePoolInvalidateTagsCommandTest extends TestCase
{
public function testComplete()
{
$tester = new CommandCompletionTester($th | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CachePoolInvalidateTagsCommandTest.php",
"language": "php",
"file_size": 4640,
"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\CacheClearCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Tests\Command\Cach... | \Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
class CacheClearCommandTest extends TestCase
{
private TestAppKernel $kernel;
private Filesystem $fs;
protected function setUp(): void
{
$this->fs = new Filesystem();
| ;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php",
"language": "php",
"file_size": 5077,
"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\FrameworkBundle\Tests\Command\CacheClearCommand\Fixture;
use Psr\Log\NullLogger;
... | ];
}
public function getProjectDir(): string
{
return __DIR__.'/test';
}
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.\DIRECTORY_SEPARATOR.'config.yml'); | ernel\CacheWarmer\CacheWarmerInterface;
use Symfony\Component\HttpKernel\Kernel;
class TestAppKernel extends Kernel
{
public function registerBundles(): iterable
{
return [
new FrameworkBundle(),
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php",
"language": "php",
"file_size": 1578,
"cut_index": 537,
"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\AboutCommand;
use Symfony\Bundle\FrameworkBundle\Command\AboutCommand;
use Sy... | ted function setUp(): void
{
$this->fs = new Filesystem();
}
public function testAboutWithReadableFiles()
{
$kernel = new TestAppKernel('test', true);
$this->fs->mkdir($kernel->getProjectDir());
$this->fs-> | mfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
class AboutCommandTest extends TestCase
{
private Filesystem $fs;
protec | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/AboutCommand/AboutCommandTest.php",
"language": "php",
"file_size": 2992,
"cut_index": 563,
"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\Tests\Command\AboutCommand\Fixture;
use Sym... | turn __DIR__.'/test';
}
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(static function (ContainerBuilder $container) {
$container->loadFromExtension('framework', []);
} | ernel;
class TestAppKernel extends Kernel
{
public function registerBundles(): iterable
{
return [
new FrameworkBundle(),
];
}
public function getProjectDir(): string
{
re | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/AboutCommand/Fixture/TestAppKernel.php",
"language": "php",
"file_size": 1088,
"cut_index": 515,
"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\Test;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Co... | ace;
class KernelTestCaseHttpCacheTest extends KernelTestCase
{
private static string $baseDir;
public static function setUpBeforeClass(): void
{
self::$baseDir = sys_get_temp_dir().'/sf_http_cache_kernel_testcase_'.uniqid('', true);
| ponent\HttpKernel\HttpCache\HttpCache;
use Symfony\Component\HttpKernel\HttpCache\Store;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterf | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Test/KernelTestCaseHttpCacheTest.php",
"language": "php",
"file_size": 4171,
"cut_index": 614,
"middle_length": 229
} |
omponent\DomCrawler\Crawler;
use Symfony\Component\HttpFoundation\Cookie as HttpFoundationCookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class WebTestCaseTest extends TestCase
{
public function testAssertResponseIsSuccessful()
{
$this->getResponseTe... | Response())->assertResponseStatusCodeSame(200);
$this->getResponseTester(new Response('', 404))->assertResponseStatusCodeSame(404);
$this->expectException(AssertionFailedError::class);
$this->expectExceptionMessage("Failed asserting | ccessful.\nHTTP/1.0 404 Not Found");
$this->getResponseTester(new Response('', 404))->assertResponseIsSuccessful();
}
public function testAssertResponseStatusCodeSame()
{
$this->getResponseTester(new | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Test/WebTestCaseTest.php",
"language": "php",
"file_size": 24025,
"cut_index": 1331,
"middle_length": 229
} |
use Symfony\Component\Webhook\Controller\WebhookController;
class ConfigurationTest extends TestCase
{
public function testDefaultConfig()
{
$processor = new Processor();
$config = $processor->processConfiguration(new Configuration(true), [[
'secret' => 's3cr3t',
'seria... | Name($sessionName)
{
$processor = new Processor();
$this->expectException(InvalidConfigurationException::class);
$processor->processConfiguration(
new Configuration(true),
[[
'session' = | {
return [
[null],
['PHPSESSID'],
['a&b'],
[',_-!@#$%^*(){}:<>/?'],
];
}
#[DataProvider('getTestInvalidSessionName')]
public function testInvalidSession | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php",
"language": "php",
"file_size": 45711,
"cut_index": 2151,
"middle_length": 229
} |
tion\InvalidDefinitionException;
use Symfony\Component\Workflow\Metadata\InMemoryMetadataStore;
use Symfony\Component\Workflow\WorkflowEvents;
use Symfony\Contracts\Cache\CacheInterface;
use Symfony\Contracts\Cache\TagAwareCacheInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
abstract class FrameworkEx... | .csrf.enabled'));
$this->assertEquals('%form.type_extension.csrf.enabled%', $def->getArgument(1));
$this->assertEquals('_csrf', $container->getParameter('form.type_extension.csrf.field_name'));
$this->assertEquals('%form.type_extens | rmCsrfProtection()
{
$container = $this->createContainerFromFile('full');
$def = $container->getDefinition('form.type_extension.csrf');
$this->assertTrue($container->getParameter('form.type_extension | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php",
"language": "php",
"file_size": 159347,
"cut_index": 7068,
"middle_length": 229
} |
r\PhpFileLoader;
use Symfony\Component\Mailer\Bridge\Brevo\Webhook\BrevoRequestParser;
use Symfony\Component\Mailer\Bridge\Postmark\Webhook\PostmarkRequestParser;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\RateLimiter\CompoundRateLimiterFactory;
use Symfony\Component\RateLimiter\... | function loadFromFile(ContainerBuilder $container, $file)
{
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php'));
$loader->load($file.'.php');
}
public function testAssetsCannotHavePathAndUrl()
| ass;
use Symfony\Component\Workflow\Exception\InvalidDefinitionException;
use Symfony\Component\Workflow\Validator\DefinitionValidatorInterface;
class PhpFrameworkExtensionTest extends FrameworkExtensionTestCase
{
protected | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/PhpFrameworkExtensionTest.php",
"language": "php",
"file_size": 22965,
"cut_index": 1331,
"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;
use Symfony\Component\Config\Definitio... | or(__DIR__.'/Fixtures/yml'));
$loader->load($file.'.yml');
}
public function testWorkflowWithSimplisticPlaceFollowedByComplexPlaceWithAlternativeSyntax()
{
$this->expectException(InvalidConfigurationException::class);
$ | r\YamlFileLoader;
class YamlFrameworkExtensionTest extends FrameworkExtensionTestCase
{
protected function loadFromFile(ContainerBuilder $container, $file)
{
$loader = new YamlFileLoader($container, new FileLocat | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/YamlFrameworkExtensionTest.php",
"language": "php",
"file_size": 1809,
"cut_index": 537,
"middle_length": 229
} |
omExtension('framework', [
'assets' => [
'version' => 'SomeVersionScheme',
'base_urls' => 'http://cdn.example.com',
'version_format' => '%%s?version=%%s',
'packages' => [
'images_path' => [
'base_path' => '/foo',
],
'images' => [
... | 'base_urls' => ['https://bar2.example.com'],
'version_strategy' => 'assets.custom_version_strategy',
],
'json_manifest_strategy' => [
'json_manifest_path' => '/path/to/manifest.json',
],
| => '1.0.0',
'version_format' => '%%s-%%s',
],
'bar' => [
'base_urls' => ['https://bar2.example.com'],
],
'bar_version_strategy' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets.php",
"language": "php",
"file_size": 1746,
"cut_index": 537,
"middle_length": 229
} |
'cache' => [
'pools' => [
'cache.foo' => [
'adapter' => 'cache.adapter.apcu',
'default_lifetime' => 30,
],
'cache.baz' => [
'adapter' => 'cache.adapter.filesystem',
'default_lifetime' => 7,
],
... | 'default_lifetime' => 12,
'adapter' => [
'cache.adapter.array',
'cache.adapter.filesystem',
'redis://foo' => 'cache.adapter.redis',
],
],
'c | 'cache.def' => [
'default_lifetime' => 'PT11S',
],
'cache.expr' => [
'default_lifetime' => '13 seconds',
],
'cache.chain' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/cache.php",
"language": "php",
"file_size": 2044,
"cut_index": 563,
"middle_length": 229
} |
y\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
$container->loadFromExtension('framework', [
'exc... | null,
],
ConflictHttpException::class => [
'log_level' => 'info',
'status_code' => 0,
],
ServiceUnavailableHttpException::class => [
'log_level' => null,
'status_code' => 500,
| 'log_level' => 'info',
'status_code' => | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/exceptions.php",
"language": "php",
"file_size": 859,
"cut_index": 529,
"middle_length": 52
} |
'secret' => 's3cr3t',
'default_locale' => 'fr',
'enabled_locales' => ['fr', 'en'],
'csrf_protection' => true,
'form' => [
'csrf_protection' => [
'field_name' => '_csrf',
],
],
'trust_x_sendfile_type_header' => true,
'esi' => [
'enabled' => true,
]... | 'name' => '_SYMFONY',
'cookie_lifetime' => 86400,
'cookie_path' => '/',
'cookie_domain' => 'example.com',
'cookie_secure' => true,
'cookie_samesite' => 'lax',
'cookie_httponly' => false,
'use_c | oject_dir%/config/routing.xml',
'type' => 'xml',
'utf8' => true,
],
'session' => [
'storage_factory_id' => 'session.storage.factory.native',
'handler_id' => 'session.handler.native_file',
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php",
"language": "php",
"file_size": 2542,
"cut_index": 563,
"middle_length": 229
} |
omExtension('framework', [
'html_sanitizer' => [
'sanitizers' => [
'custom' => [
'default_action' => 'allow',
'allow_safe_elements' => true,
'allow_static_elements' => true,
'allow_elements' => [
'iframe' => 'src... | 'data-attr' => ['custom-tag'],
'data-attr-1' => [],
'data-attr-2' => '*',
],
'force_attributes' => [
'a' => ['rel' => 'noopener noreferrer'],
| 'drop_elements' => ['video'],
'allow_attributes' => [
'src' => ['iframe'],
'data-attr' => '*',
],
'drop_attributes' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php",
"language": "php",
"file_size": 1822,
"cut_index": 537,
"middle_length": 229
} |
?php
$container->loadFromExtension('framework', [
'http_client' => [
'default_options' => [
'headers' => ['X-powered' => 'PHP'],
'max_redirects' => 2,
'http_version' => '2.0',
'resolve' => ['localhost' => '127.0.0.1'],
'proxy' => 'proxy.org',
... | 'RC4-SHA:TLS13-AES-128-GCM-SHA256',
'peer_fingerprint' => [
'pin-sha256' => ['14s5erg62v1v8471g2revg48r7==', 'jsda84hjtyd4821bgfesd215bsfg5412='],
'md5' => 'sdhtb481248721thbr=',
],
'extr | '/etc/ssl/cafile',
'capath' => '/etc/ssl',
'local_cert' => '/etc/ssl/cert.pem',
'local_pk' => '/etc/ssl/private_key.pem',
'passphrase' => 'password123456',
'ciphers' => | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.php",
"language": "php",
"file_size": 1055,
"cut_index": 513,
"middle_length": 229
} |
p
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
return static function (ContainerConfigurator $container) {
$container->extension('framework', [
'mailer' => [
'transports' => [
'transport1' => 'smtp://example1.com',
'transport2' => 'smtp:/... | @example\.org', '.*@example\.com'],
],
'headers' => [
'from' => 'from@example.org',
'bcc' => ['bcc1@example.org', 'bcc2@example.org'],
'foo' => 'bar',
],
],
]); | '],
'allowed_recipients' => ['foobar | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/mailer_with_transports.php",
"language": "php",
"file_size": 828,
"cut_index": 516,
"middle_length": 52
} |
hp
$container->loadFromExtension('framework', [
'serializer' => true,
'messenger' => [
'failure_transport' => 'failed',
'serializer' => [
'default_serializer' => 'messenger.transport.symfony_serializer',
],
'transports' => [
'default' => 'amqp://localhost... | 3,
'max_delay' => 100,
],
'rate_limiter' => 'customised_worker',
],
'failed' => 'in-memory:///',
'redis' => 'redis://127.0.0.1:6379/messages',
'beanstalkd' | ],
'serializer' => 'messenger.transport.native_php_serializer',
'retry_strategy' => [
'max_retries' => 10,
'delay' => 7,
'multiplier' => | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/messenger_transports.php",
"language": "php",
"file_size": 1105,
"cut_index": 515,
"middle_length": 229
} |
onfigurator\ContainerConfigurator $container) {
$container->services()->alias('test_workflow', 'workflow.test_workflow')->public();
$container->extension('framework', [
'workflows' => [
'test_workflow' => [
'type' => 'workflow',
'supports' => [
... | e',
'end',
'alternative',
],
'transitions' => [
'base_transition' => [
'from' => ['start'],
'to' => ['end'],
| 'start',
'middl | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_base_config.php",
"language": "php",
"file_size": 962,
"cut_index": 582,
"middle_length": 52
} |
ponent\DependencyInjection\Loader\Configurator\ContainerConfigurator $container) {
$container->extension('framework', [
'workflows' => [
'test_workflow' => [
'type' => 'workflow',
'supports' => [
'Symfony\Bundle\FrameworkBundle\Tests\Dependency... | lternative',
],
'transitions' => [
'base_transition' => [
'from' => ['middle'],
'to' => ['alternative'],
],
],
| ',
'end',
'a | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_override_config.php",
"language": "php",
"file_size": 883,
"cut_index": 547,
"middle_length": 52
} |
\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'article' => [
'type' => 'workflow',
'supports' => [
FrameworkExtensionTestCase::class,
],
'initial_marking' =... | 'name' => 'approved_by_journalist',
],
'wait_for_spellchecker',
'approved_by_spellchecker',
'published',
],
'transitions' => [
'reques | 'draft' => [
'metadata' => [
'foo' => 'bar',
],
],
'wait_for_journalist',
'approved_by_journalist' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_complex_place_follow_by_simplistic_place_config.php",
"language": "php",
"file_size": 1731,
"cut_index": 537,
"middle_length": 229
} |
\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'article' => [
'type' => 'workflow',
'supports' => [
FrameworkExtensionTestCase::class,
],
'initial_marking' =... | journalist', 'wait_for_spellchecker'],
],
'journalist_approval' => [
'from' => 'wait_for_journalist',
'to' => 'approved_by_journalist',
],
'spellchecker | 'approved_by_spellchecker',
'published',
],
'transitions' => [
'request_review' => [
'from' => 'draft',
'to' => ['wait_for_ | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php",
"language": "php",
"file_size": 1652,
"cut_index": 537,
"middle_length": 229
} |
\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'article' => [
'type' => 'workflow',
'supports' => [
FrameworkExtensionTestCase::class,
],
'initial_marking' =... | 'from' => 'draft',
'to' => ['wait_for_journalist', 'wait_for_spellchecker'],
],
'journalist_approval' => [
'from' => ['wait_for_journalist'],
'to' => 'approv | 'approved_by_spellchecker',
'published',
],
// We also test different configuration formats here
'transitions' => [
'request_review' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php",
"language": "php",
"file_size": 1694,
"cut_index": 537,
"middle_length": 229
} |
hp
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'my_workflow' => [
'type' => 'state_machine',
'marking_store' => [
'type' => 'method',
'property... | ],
'to' => [
'two',
],
],
'count_to_three' => [
'from' => [
'two',
],
't | 'one',
'two',
'three',
],
'transitions' => [
'count_to_two' => [
'from' => [
'one',
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php",
"language": "php",
"file_size": 1120,
"cut_index": 515,
"middle_length": 229
} |
\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'article' => [
'type' => 'workflow',
'supports' => [
FrameworkExtensionTestCase::class,
],
'initial_marking' =... | ],
'approved_by_journalist' => [
'name' => 'approved_by_journalist',
],
'wait_for_spellchecker',
'approved_by_spellchecker',
'published',
| 'draft',
'wait_for_journalist' => [
'metadata' => [
'description' => 'The article is awaiting approval of an authorized journalist.',
],
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_simplistic_place_follow_by_complex_place_config.php",
"language": "php",
"file_size": 1797,
"cut_index": 537,
"middle_length": 229
} |
use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase;
$container->loadFromExtension('framework', [
'workflows' => [
'my_workflow' => [
'type' => 'state_machine',
'marking_store' => [
'property' => 'state',
],
... | 'one',
],
'to' => [
'two',
],
],
'count_to_three' => [
'from' => [
'two', | ,
],
'places' => [
'one',
'two',
'three',
],
'transitions' => [
'count_to_two' => [
'from' => [
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php",
"language": "php",
"file_size": 1169,
"cut_index": 518,
"middle_length": 229
} |
ainer->loadFromExtension('framework', [
'workflows' => [
'article' => [
'type' => 'workflow',
'supports' => [
FrameworkExtensionTestCase::class,
],
'definition_validators' => [
Symfony\Bundle\FrameworkBundle\Tests\DependencyInje... | t_for_spellchecker',
'approved_by_spellchecker',
'published',
],
'transitions' => [
'request_review' => [
'from' => 'draft',
'to' => ['wait_for_ | w',
'description' => 'workflow for articles',
],
'places' => [
'draft',
'wait_for_journalist',
'approved_by_journalist',
'wai | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/workflows.php",
"language": "php",
"file_size": 4061,
"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\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\Attribu... | ertyValueTransformerTagToLegacyValueTransformers()
{
$container = new ContainerBuilder();
$container->register('json_streamer.stream_reader')->setArguments([null]);
$container->register('json_streamer.stream_writer')->setArgume | ormerTagPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class DeprecateJsonStreamerValueTransformerTagPassTest extends TestCase
{
#[Group('legacy')]
#[IgnoreDeprecations]
public function testAddProp | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/DeprecateJsonStreamerValueTransformerTagPassTest.php",
"language": "php",
"file_size": 1921,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PhpConfigReferenceDumpPass;
use Symfony\Component\Config\Definition\B... | \Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class PhpConfigReferenceDumpPassTest extends TestCase
{
private string $readOnlyDir;
private string $tempDir;
protected function setUp(): void
{
$this->tempDi | ileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/PhpConfigReferenceDumpPassTest.php",
"language": "php",
"file_size": 8828,
"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\DependencyInjection\Compiler;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\Framewor... | ainerBuilder;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
class ProfilerPassTest extends TestCase
{
/**
* Tests that collector | er\ProfilerPass;
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass;
use Symfony\Component\DependencyInjection\Cont | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php",
"language": "php",
"file_size": 4887,
"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\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\D... | y\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\HttpKernel\Kernel;
class TestServiceContainerRefPassesTest extends TestCase
{
public function testProcess()
{
$conta | \Test\TestContainer;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfon | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php",
"language": "php",
"file_size": 4558,
"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\Attributes\DataProvider;
use PHPUnit\Framework\TestCas... | unction testComplete(array $input, array $expectedSuggestions)
{
$tester = $this->createCommandCompletionTester();
$suggestions = $tester->complete($input);
$this->assertSame($expectedSuggestions, $suggestions);
}
pub | r;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Mailer\Event\MessageEvent;
class EventDispatcherDebugCommandTest extends TestCase
{
#[DataProvider('provideCompletionSuggestions')]
public f | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/EventDispatcherDebugCommandTest.php",
"language": "php",
"file_size": 2384,
"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\Tests\Command;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Comma... | ir().'/sf_secrets/main/';
$this->localDir = sys_get_temp_dir().'/sf_secrets/local/';
$fs = new Filesystem();
$fs->remove([$this->mainDir, $this->localDir]);
$mainVault = new SodiumVault($this->mainDir);
$mainVault- | uiresPhpExtension('sodium')]
class SecretsDecryptToLocalCommandTest extends TestCase
{
private string $mainDir;
private string $localDir;
protected function setUp(): void
{
$this->mainDir = sys_get_temp_d | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsDecryptToLocalCommandTest.php",
"language": "php",
"file_size": 3675,
"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\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Comma... | p';
private const DEC_KEY_FILE = 'test.decrypt.private.php';
protected function setUp(): void
{
$this->secretsDir = sys_get_temp_dir().'/sf_secrets/test/';
(new Filesystem())->remove($this->secretsDir);
}
protected fun | ter;
use Symfony\Component\Filesystem\Filesystem;
#[RequiresPhpExtension('sodium')]
class SecretsGenerateKeysCommandTest extends TestCase
{
private string $secretsDir;
private const ENC_KEY_FILE = 'test.encrypt.public.ph | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsGenerateKeysCommandTest.php",
"language": "php",
"file_size": 3166,
"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\Attributes\BackupGlobals;
use PHPUnit\Framework\TestCa... | ->method('list')->willReturn(['A' => 'a', 'B' => 'b', 'C' => null, 'D' => null, 'E' => null]);
$_ENV = ['A' => '', 'B' => 'A', 'C' => '', 'D' => false, 'E' => null];
$localVault = new DotenvVault('/not/a/path');
$command = new Sec | \Component\Console\Tester\CommandTester;
class SecretsListCommandTest extends TestCase
{
#[BackupGlobals(true)]
public function testExecute()
{
$vault = $this->createStub(AbstractVault::class);
$vault | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsListCommandTest.php",
"language": "php",
"file_size": 2053,
"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\Tests\Command;
use PHPUnit\Framework\Attributes\Data... | $this->createStub(AbstractVault::class);
$vault->method('list')->willReturn(['SECRET' => null, 'OTHER_SECRET' => null]);
$localVault = $this->createStub(AbstractVault::class);
$command = new SecretsSetCommand($vault, $localVault);
| Tester\CommandCompletionTester;
class SecretsSetCommandTest extends TestCase
{
#[DataProvider('provideCompletionSuggestions')]
public function testComplete(array $input, array $expectedSuggestions)
{
$vault = | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/SecretsSetCommandTest.php",
"language": "php",
"file_size": 1426,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Command;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Co... | nt\Translation\Reader\TranslationReader;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\Writer\TranslationWriter;
class TranslationExtractCommandCompletionTest extends TestCase
{
private Filesystem $fs;
private str |
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
use Symfony\Component\Translation\Extractor\ExtractorInterface;
use Symfony\Compone | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationExtractCommandCompletionTest.php",
"language": "php",
"file_size": 5163,
"cut_index": 716,
"middle_length": 229
} |
Command\TranslationExtractCommand;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\... | ase
{
private Filesystem $fs;
private string $translationDir;
public function testDumpMessagesAndClean()
{
$tester = $this->createCommandTester(['messages' => ['foo' => 'foo']]);
$tester->execute(['command' => 'translation: | ueInterface;
use Symfony\Component\Translation\Reader\TranslationReader;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\Writer\TranslationWriter;
class TranslationExtractCommandTest extends TestC | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationExtractCommandTest.php",
"language": "php",
"file_size": 15694,
"cut_index": 921,
"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\FrameworkBundle\Tests\Kernel;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\HttpFoundation\Response;
use Symfony\C... | (): string
{
return $this->cacheDir ??= sys_get_temp_dir().'/sf_default_kernel';
}
public function getLogDir(): string
{
return $this->cacheDir;
}
public function getProjectDir(): string
{
return \dirna | e string $cacheDir;
public function getCacheDir | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/default/src/DefaultKernel.php",
"language": "php",
"file_size": 935,
"cut_index": 606,
"middle_length": 52
} |
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\Secrets;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle... | )
{
$vault = new DotenvVault($this->envFile);
$this->assertFalse($vault->generateKeys());
$this->assertSame('The dotenv vault doesn\'t encrypt secrets thus doesn\'t need keys.', $vault->getLastMessage());
}
public func | $this->envFile = sys_get_temp_dir().'/sf_secrets.env.test';
@unlink($this->envFile);
}
protected function tearDown(): void
{
@unlink($this->envFile);
}
public function testGenerateKeys( | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Secrets/DotenvVaultTest.php",
"language": "php",
"file_size": 1828,
"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\Secrets;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Secre... | lesystem->remove($this->secretsDir);
}
protected function tearDown(): void
{
$this->filesystem->remove($this->secretsDir);
}
public function testGenerateKeys()
{
$vault = new SodiumVault($this->secretsDir);
| ring $secretsDir;
private Filesystem $filesystem;
protected function setUp(): void
{
$this->filesystem = new Filesystem();
$this->secretsDir = sys_get_temp_dir().'/sf_secrets/test/';
$this->fi | {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Secrets/SodiumVaultTest.php",
"language": "php",
"file_size": 3426,
"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\Controller;
use Psr\Container\ContainerInterface;
use Symfony\Bundle\FrameworkBundle\... | parent::__construct($container);
}
};
}
public function testSync()
{
$r = new \ReflectionClass(ControllerHelper::class);
$m = $r->getMethod('getSubscribedServices');
$helperSrc = file($r->get | ler()
{
return new class extends ControllerHelper {
public function __construct()
{
}
public function setContainer(ContainerInterface $container)
{
| {
"filepath": "src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerHelperTest.php",
"language": "php",
"file_size": 2342,
"cut_index": 563,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.