This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?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\Controller;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class FragmentController implements ContainerAwareInterface
{
use ContainerAwareTrait;
public function indexAction(Request $request)
{
return $this->container->get('templating')->renderResponse('fragment.html.php', array('bar' => new Bar()));
}
public function inlinedAction($options, $_format)
{
return new Response($options['bar']->getBar().' '.$_format);
}
public function customFormatAction($_format)
{
return new Response($_format);
}
public function customLocaleAction(Request $request)
{
return new Response($request->getLocale());
}
public function forwardLocaleAction(Request $request)
{
return new Response($request->getLocale());
}
}
class Bar
{
private $bar = 'bar';
public function getBar()
{
return $this->bar;
}
}

View File

@@ -0,0 +1,26 @@
<?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\Controller;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\Response;
class ProfilerController implements ContainerAwareInterface
{
use ContainerAwareTrait;
public function indexAction()
{
return new Response('Hello');
}
}

View File

@@ -0,0 +1,73 @@
<?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\Controller;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
class SessionController implements ContainerAwareInterface
{
use ContainerAwareTrait;
public function welcomeAction(Request $request, $name = null)
{
$session = $request->getSession();
// new session case
if (!$session->has('name')) {
if (!$name) {
return new Response('You are new here and gave no name.');
}
// remember name
$session->set('name', $name);
return new Response(sprintf('Hello %s, nice to meet you.', $name));
}
// existing session
$name = $session->get('name');
return new Response(sprintf('Welcome back %s, nice to meet you.', $name));
}
public function logoutAction(Request $request)
{
$request->getSession()->invalidate();
return new Response('Session cleared.');
}
public function setFlashAction(Request $request, $message)
{
$session = $request->getSession();
$session->getFlashBag()->set('notice', $message);
return new RedirectResponse($this->container->get('router')->generate('session_showflash'));
}
public function showFlashAction(Request $request)
{
$session = $request->getSession();
if ($session->getFlashBag()->has('notice')) {
list($output) = $session->getFlashBag()->get('notice');
} else {
$output = 'No flash was set.';
}
return new Response($output);
}
}

View File

@@ -0,0 +1,68 @@
<?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\Controller;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
class SubRequestController implements ContainerAwareInterface
{
use ContainerAwareTrait;
public function indexAction()
{
$handler = $this->container->get('fragment.handler');
$errorUrl = $this->generateUrl('subrequest_fragment_error', array('_locale' => 'fr', '_format' => 'json'));
$altUrl = $this->generateUrl('subrequest_fragment', array('_locale' => 'fr', '_format' => 'json'));
// simulates a failure during the rendering of a fragment...
// should render fr/json
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
// ...to check that the FragmentListener still references the right Request
// when rendering another fragment after the error occurred
// should render en/html instead of fr/json
$content .= $handler->render(new ControllerReference('TestBundle:SubRequest:fragment'));
// forces the LocaleListener to set fr for the locale...
// should render fr/json
$content .= $handler->render($altUrl);
// ...and check that after the rendering, the original Request is back
// and en is used as a locale
// should use en/html instead of fr/json
$content .= '--'.$this->generateUrl('subrequest_fragment');
// The RouterListener is also tested as if it does not keep the right
// Request in the context, a 301 would be generated
return new Response($content);
}
public function fragmentAction(Request $request)
{
return new Response('--'.$request->getLocale().'/'.$request->getRequestFormat());
}
public function fragmentErrorAction()
{
throw new \RuntimeException('error');
}
protected function generateUrl($name, $arguments = array())
{
return $this->container->get('router')->generate($name, $arguments);
}
}

View File

@@ -0,0 +1,24 @@
<?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\DependencyInjection\Config;
class CustomConfig
{
public function addConfiguration($rootNode)
{
$rootNode
->children()
->scalarNode('custom')->end()
->end()
;
}
}

View File

@@ -0,0 +1,37 @@
<?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\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
private $customConfig;
public function __construct($customConfig = null)
{
$this->customConfig = $customConfig;
}
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('test');
if ($this->customConfig) {
$this->customConfig->addConfiguration($rootNode);
}
return $treeBuilder;
}
}

View File

@@ -0,0 +1,51 @@
<?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\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
class TestExtension extends Extension implements PrependExtensionInterface
{
private $customConfig;
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
}
/**
* {@inheritdoc}
*/
public function prepend(ContainerBuilder $container)
{
$container->prependExtensionConfig('test', array('custom' => 'foo'));
}
/**
* {@inheritdoc}
*/
public function getConfiguration(array $config, ContainerBuilder $container)
{
return new Configuration($this->customConfig);
}
public function setCustomConfig($customConfig)
{
$this->customConfig = $customConfig;
}
}

View File

@@ -0,0 +1,46 @@
session_welcome:
path: /session
defaults: { _controller: TestBundle:Session:welcome }
session_welcome_name:
path: /session/{name}
defaults: { _controller: TestBundle:Session:welcome }
session_logout:
path: /session_logout
defaults: { _controller: TestBundle:Session:logout}
session_setflash:
path: /session_setflash/{message}
defaults: { _controller: TestBundle:Session:setFlash}
session_showflash:
path: /session_showflash
defaults: { _controller: TestBundle:Session:showFlash}
profiler:
path: /profiler
defaults: { _controller: TestBundle:Profiler:index }
subrequest_index:
path: /subrequest/{_locale}.{_format}
defaults: { _controller: TestBundle:SubRequest:index, _format: "html" }
schemes: [https]
subrequest_fragment_error:
path: /subrequest/fragment/error/{_locale}.{_format}
defaults: { _controller: TestBundle:SubRequest:fragmentError, _format: "html" }
schemes: [http]
subrequest_fragment:
path: /subrequest/fragment/{_locale}.{_format}
defaults: { _controller: TestBundle:SubRequest:fragment, _format: "html" }
schemes: [http]
fragment_home:
path: /fragment_home
defaults: { _controller: TestBundle:Fragment:index, _format: txt }
fragment_inlined:
path: /fragment_inlined
defaults: { _controller: TestBundle:Fragment:inlined }

View File

@@ -0,0 +1,29 @@
<?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;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\DependencyInjection\Config\CustomConfig;
class TestBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
/** @var $extension DependencyInjection\TestExtension */
$extension = $container->getExtension('test');
$extension->setCustomConfig(new CustomConfig());
}
}

View File

@@ -0,0 +1,51 @@
<?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;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Tester\CommandTester;
/**
* @group functional
*/
class ConfigDebugCommandTest extends WebTestCase
{
private $application;
protected function setUp()
{
$kernel = static::createKernel(array('test_case' => 'ConfigDump', 'root_config' => 'config.yml'));
$this->application = new Application($kernel);
$this->application->doRun(new ArrayInput(array()), new NullOutput());
}
public function testDumpBundleName()
{
$tester = $this->createCommandTester();
$ret = $tester->execute(array('name' => 'TestBundle'));
$this->assertSame(0, $ret, 'Returns 0 in case of success');
$this->assertContains('custom: foo', $tester->getDisplay());
}
/**
* @return CommandTester
*/
private function createCommandTester()
{
$command = $this->application->find('debug:config');
return new CommandTester($command);
}
}

View File

@@ -0,0 +1,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\Functional;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Tester\CommandTester;
/**
* @group functional
*/
class ConfigDumpReferenceCommandTest extends WebTestCase
{
private $application;
protected function setUp()
{
$kernel = static::createKernel(array('test_case' => 'ConfigDump', 'root_config' => 'config.yml'));
$this->application = new Application($kernel);
$this->application->doRun(new ArrayInput(array()), new NullOutput());
}
public function testDumpBundleName()
{
$tester = $this->createCommandTester();
$ret = $tester->execute(array('name' => 'TestBundle'));
$this->assertSame(0, $ret, 'Returns 0 in case of success');
$this->assertContains('test:', $tester->getDisplay());
$this->assertContains(' custom:', $tester->getDisplay());
}
/**
* @return CommandTester
*/
private function createCommandTester()
{
$command = $this->application->find('config:dump-reference');
return new CommandTester($command);
}
}

View File

@@ -0,0 +1,38 @@
<?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;
class FragmentTest extends WebTestCase
{
/**
* @dataProvider getConfigs
*/
public function testFragment($insulate)
{
$client = $this->createClient(array('test_case' => 'Fragment', 'root_config' => 'config.yml'));
if ($insulate) {
$client->insulate();
}
$client->request('GET', '/fragment_home');
$this->assertEquals('bar txt--html--es--fr', $client->getResponse()->getContent());
}
public function getConfigs()
{
return array(
array(false),
array(true),
);
}
}

View File

@@ -0,0 +1,46 @@
<?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;
class ProfilerTest extends WebTestCase
{
/**
* @dataProvider getConfigs
*/
public function testProfilerIsDisabled($insulate)
{
$client = $this->createClient(array('test_case' => 'Profiler', 'root_config' => 'config.yml'));
if ($insulate) {
$client->insulate();
}
$client->request('GET', '/profiler');
$this->assertFalse($client->getProfile());
// enable the profiler for the next request
$client->enableProfiler();
$crawler = $client->request('GET', '/profiler');
$profile = $client->getProfile();
$this->assertTrue(is_object($profile));
$client->request('GET', '/profiler');
$this->assertFalse($client->getProfile());
}
public function getConfigs()
{
return array(
array(false),
array(true),
);
}
}

View File

@@ -0,0 +1,151 @@
<?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;
class SessionTest extends WebTestCase
{
/**
* Tests session attributes persist.
*
* @dataProvider getConfigs
*/
public function testWelcome($config, $insulate)
{
$client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config));
if ($insulate) {
$client->insulate();
}
// no session
$crawler = $client->request('GET', '/session');
$this->assertContains('You are new here and gave no name.', $crawler->text());
// remember name
$crawler = $client->request('GET', '/session/drak');
$this->assertContains('Hello drak, nice to meet you.', $crawler->text());
// prove remembered name
$crawler = $client->request('GET', '/session');
$this->assertContains('Welcome back drak, nice to meet you.', $crawler->text());
// clear session
$crawler = $client->request('GET', '/session_logout');
$this->assertContains('Session cleared.', $crawler->text());
// prove cleared session
$crawler = $client->request('GET', '/session');
$this->assertContains('You are new here and gave no name.', $crawler->text());
}
/**
* Tests flash messages work in practice.
*
* @dataProvider getConfigs
*/
public function testFlash($config, $insulate)
{
$client = $this->createClient(array('test_case' => 'Session', 'root_config' => $config));
if ($insulate) {
$client->insulate();
}
// set flash
$crawler = $client->request('GET', '/session_setflash/Hello%20world.');
// check flash displays on redirect
$this->assertContains('Hello world.', $client->followRedirect()->text());
// check flash is gone
$crawler = $client->request('GET', '/session_showflash');
$this->assertContains('No flash was set.', $crawler->text());
}
/**
* See if two separate insulated clients can run without
* polluting eachother's session data.
*
* @dataProvider getConfigs
*/
public function testTwoClients($config, $insulate)
{
// start first client
$client1 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config));
if ($insulate) {
$client1->insulate();
}
// start second client
$client2 = $this->createClient(array('test_case' => 'Session', 'root_config' => $config));
if ($insulate) {
$client2->insulate();
}
// new session, so no name set.
$crawler1 = $client1->request('GET', '/session');
$this->assertContains('You are new here and gave no name.', $crawler1->text());
// set name of client1
$crawler1 = $client1->request('GET', '/session/client1');
$this->assertContains('Hello client1, nice to meet you.', $crawler1->text());
// no session for client2
$crawler2 = $client2->request('GET', '/session');
$this->assertContains('You are new here and gave no name.', $crawler2->text());
// remember name client2
$crawler2 = $client2->request('GET', '/session/client2');
$this->assertContains('Hello client2, nice to meet you.', $crawler2->text());
// prove remembered name of client1
$crawler1 = $client1->request('GET', '/session');
$this->assertContains('Welcome back client1, nice to meet you.', $crawler1->text());
// prove remembered name of client2
$crawler2 = $client2->request('GET', '/session');
$this->assertContains('Welcome back client2, nice to meet you.', $crawler2->text());
// clear client1
$crawler1 = $client1->request('GET', '/session_logout');
$this->assertContains('Session cleared.', $crawler1->text());
// prove client1 data is cleared
$crawler1 = $client1->request('GET', '/session');
$this->assertContains('You are new here and gave no name.', $crawler1->text());
// prove remembered name of client2 remains untouched.
$crawler2 = $client2->request('GET', '/session');
$this->assertContains('Welcome back client2, nice to meet you.', $crawler2->text());
}
public function getConfigs()
{
return array(
// configfile, insulate
array('config.yml', true),
array('config.yml', false),
);
}
protected function setUp()
{
parent::setUp();
$this->deleteTmpDir('SessionTest');
}
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('SessionTest');
}
}

View File

@@ -0,0 +1,23 @@
<?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;
class SubRequestsTest extends WebTestCase
{
public function testStateAfterSubRequest()
{
$client = $this->createClient(array('test_case' => 'Session', 'root_config' => 'config.yml'));
$client->request('GET', 'https://localhost/subrequest/en');
$this->assertEquals('--fr/json--en/html--fr/json--http://localhost/subrequest/fragment/en', $client->getResponse()->getContent());
}
}

View File

@@ -0,0 +1,58 @@
<?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;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase as BaseWebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
class WebTestCase extends BaseWebTestCase
{
public static function assertRedirect($response, $location)
{
self::assertTrue($response->isRedirect(), 'Response is not a redirect, got status code: '.$response->getStatusCode());
self::assertEquals('http://localhost'.$location, $response->headers->get('Location'));
}
protected function deleteTmpDir($testCase)
{
if (!file_exists($dir = sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$testCase)) {
return;
}
$fs = new Filesystem();
$fs->remove($dir);
}
protected static function getKernelClass()
{
require_once __DIR__.'/app/AppKernel.php';
return 'Symfony\Bundle\FrameworkBundle\Tests\Functional\app\AppKernel';
}
protected static function createKernel(array $options = array())
{
$class = self::getKernelClass();
if (!isset($options['test_case'])) {
throw new \InvalidArgumentException('The option "test_case" must be set.');
}
return new $class(
$options['test_case'],
isset($options['root_config']) ? $options['root_config'] : 'config.yml',
isset($options['environment']) ? $options['environment'] : 'frameworkbundletest'.strtolower($options['test_case']),
isset($options['debug']) ? $options['debug'] : true
);
}
}

View File

@@ -0,0 +1,115 @@
<?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\app;
// get the autoload file
$dir = __DIR__;
$lastDir = null;
while ($dir !== $lastDir) {
$lastDir = $dir;
if (file_exists($dir.'/autoload.php')) {
require_once $dir.'/autoload.php';
break;
}
if (file_exists($dir.'/autoload.php.dist')) {
require_once $dir.'/autoload.php.dist';
break;
}
if (file_exists($dir.'/vendor/autoload.php')) {
require_once $dir.'/vendor/autoload.php';
break;
}
$dir = dirname($dir);
}
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
/**
* App Test Kernel for functional tests.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class AppKernel extends Kernel
{
private $testCase;
private $rootConfig;
public function __construct($testCase, $rootConfig, $environment, $debug)
{
if (!is_dir(__DIR__.'/'.$testCase)) {
throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase));
}
$this->testCase = $testCase;
$fs = new Filesystem();
if (!$fs->isAbsolutePath($rootConfig) && !file_exists($rootConfig = __DIR__.'/'.$testCase.'/'.$rootConfig)) {
throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig));
}
$this->rootConfig = $rootConfig;
parent::__construct($environment, $debug);
}
public function registerBundles()
{
if (!file_exists($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) {
throw new \RuntimeException(sprintf('The bundles file "%s" does not exist.', $filename));
}
return include $filename;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment;
}
public function getLogDir()
{
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->rootConfig);
}
public function serialize()
{
return serialize(array($this->testCase, $this->rootConfig, $this->getEnvironment(), $this->isDebug()));
}
public function unserialize($str)
{
$a = unserialize($str);
$this->__construct($a[0], $a[1], $a[2], $a[3]);
}
protected function getKernelParameters()
{
$parameters = parent::getKernelParameters();
$parameters['kernel.test_case'] = $this->testCase;
return $parameters;
}
}

View File

@@ -0,0 +1,18 @@
<?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.
*/
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
return array(
new FrameworkBundle(),
new TestBundle(),
);

View File

@@ -0,0 +1,2 @@
imports:
- { resource: ../config/default.yml }

View File

@@ -0,0 +1,18 @@
<?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.
*/
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
return array(
new FrameworkBundle(),
new TestBundle(),
);

View File

@@ -0,0 +1,7 @@
imports:
- { resource: ../config/default.yml }
framework:
fragments: ~
templating:
engines: ['php']

View File

@@ -0,0 +1,2 @@
_fragmenttest_bundle:
resource: '@TestBundle/Resources/config/routing.yml'

View File

@@ -0,0 +1,18 @@
<?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.
*/
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
return array(
new FrameworkBundle(),
new TestBundle(),
);

View File

@@ -0,0 +1,7 @@
imports:
- { resource: ../config/default.yml }
framework:
profiler:
enabled: true
collect: false

View File

@@ -0,0 +1,2 @@
_sessiontest_bundle:
resource: '@TestBundle/Resources/config/routing.yml'

View File

@@ -0,0 +1,14 @@
<?php echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:inlined', array(
'options' => array(
'bar' => $bar,
'eleven' => 11,
),
)));
?>--<?php
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customformat', array('_format' => 'html')));
?>--<?php
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customlocale', array('_locale' => 'es')));
?>--<?php
$app->getRequest()->setLocale('fr');
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:forwardlocale'));
?>

View File

@@ -0,0 +1,18 @@
<?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.
*/
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
return array(
new FrameworkBundle(),
new TestBundle(),
);

View File

@@ -0,0 +1,2 @@
imports:
- { resource: ./../config/default.yml }

View File

@@ -0,0 +1,2 @@
_sessiontest_bundle:
resource: '@TestBundle/Resources/config/routing.yml'

View File

@@ -0,0 +1,2 @@
imports:
- { resource: framework.yml }

View File

@@ -0,0 +1,13 @@
framework:
secret: test
router: { resource: "%kernel.root_dir%/%kernel.test_case%/routing.yml" }
validation: { enabled: true, enable_annotations: true }
csrf_protection: true
form: true
test: ~
default_locale: en
session:
storage_id: session.storage.mock_file
services:
logger: { class: Psr\Log\NullLogger }