N°2651 rollback gitignore for lib tests dirs

Too dangerous ! We'll work properly on this but for 2.8
This commit is contained in:
Pierre Goiffon
2020-01-10 15:15:15 +01:00
parent 881fc2a1de
commit ad821e7d9c
2086 changed files with 151849 additions and 6 deletions

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

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

View File

@@ -0,0 +1,4 @@
annotated_controller:
prefix: /annotated
resource: "@TestBundle/Controller/AnnotatedController.php"
type: annotation

View File

@@ -0,0 +1,100 @@
<?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;
use Psr\Log\NullLogger;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
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 $varDir;
private $testCase;
private $rootConfig;
public function __construct($varDir, $testCase, $rootConfig, $environment, $debug)
{
if (!is_dir(__DIR__.'/'.$testCase)) {
throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase));
}
$this->varDir = $varDir;
$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().'/'.$this->varDir.'/'.$this->testCase.'/cache/'.$this->environment;
}
public function getLogDir()
{
return sys_get_temp_dir().'/'.$this->varDir.'/'.$this->testCase.'/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->rootConfig);
}
protected function build(ContainerBuilder $container)
{
$container->register('logger', NullLogger::class);
}
public function serialize()
{
return serialize([$this->varDir, $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], $a[4]);
}
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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,11 @@
imports:
- { resource: ../config/default.yml }
services:
_defaults: { public: true }
test.autowiring_types.autowired_services:
class: Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\AutowiringTypes\AutowiredServices
autowire: true
framework:
templating:
engines: ['php']

View File

@@ -0,0 +1,6 @@
imports:
- { resource: config.yml }
framework:
annotations:
cache: none

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,22 @@
imports:
- { resource: ../config/default.yml }
services:
dummy:
class: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\DeclaredClass
arguments: ['@cache.private_pool']
public: true
custom_clearer:
parent: cache.default_clearer
tags:
- name: kernel.cache_clearer
framework:
cache:
pools:
cache.private_pool: ~
cache.public_pool:
public: true
cache.pool_with_clearer:
public: true
clearer: custom_clearer

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,14 @@
imports:
- { resource: ../config/default.yml }
framework:
cache:
pools:
cache.pool1:
public: true
adapter: cache.system
cache.pool2:
public: true
adapter: cache.pool3
cache.pool3:
clearer: ~

View File

@@ -0,0 +1,17 @@
imports:
- { resource: ../config/default.yml }
parameters:
env(REDIS_HOST): 'localhost'
framework:
cache:
app: cache.adapter.redis
default_redis_provider: "redis://%env(REDIS_HOST)%"
pools:
cache.pool1:
public: true
clearer: cache.system_clearer
cache.pool2:
public: true
clearer: ~

View File

@@ -0,0 +1,28 @@
imports:
- { resource: ../config/default.yml }
parameters:
env(REDIS_HOST): 'localhost'
services:
cache.test_redis_connection:
public: false
class: Redis
calls:
- [connect, ['%env(REDIS_HOST)%']]
cache.app:
parent: cache.adapter.redis
tags:
- name: cache.pool
provider: cache.test_redis_connection
framework:
cache:
pools:
cache.pool1:
public: true
clearer: cache.system_clearer
cache.pool2:
public: true
clearer: ~

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,10 @@
imports:
- { resource: ../config/default.yml }
framework:
secret: '%secret%'
default_locale: '%env(LOCALE)%'
parameters:
env(LOCALE): en
secret: test

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,10 @@
imports:
- { resource: ../config/default.yml }
services:
_defaults: { public: true }
public:
class: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\DeclaredClass
private_alias:
alias: public
public: false

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,21 @@
imports:
- { resource: ../config/default.yml }
framework:
esi: true
ssi: true
fragments: true
profiler: true
router: true
session: true
request: true
templating:
enabled: true
engines: ['php']
assets: true
translator: true
validation: true
serializer: true
property_info: true
csrf_protection: true
form: true

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,10 @@
imports:
- { resource: ../config/default.yml }
services:
Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SubRequestServiceResolutionController:
public: true
tags: [controller.service_arguments]
logger: { class: Psr\Log\NullLogger }
Psr\Log\LoggerInterface: '@logger'

View File

@@ -0,0 +1,4 @@
sub_request_page:
path: /subrequest
defaults:
_controller: 'TestBundle:SubRequestServiceResolution:index'

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
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', [
'options' => [
'bar' => $bar,
'eleven' => 11,
],
]));
?>--<?php
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customformat', ['_format' => 'html']));
?>--<?php
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:customlocale', ['_locale' => 'es']));
?>--<?php
$app->getRequest()->setLocale('fr');
echo $this->get('actions')->render($this->get('actions')->controller('TestBundle:Fragment:forwardlocale'));
?>

View File

@@ -0,0 +1,16 @@
<?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\FrameworkBundle;
return [
new FrameworkBundle(),
];

View File

@@ -0,0 +1,10 @@
imports:
- { resource: ../config/default.yml }
services:
_defaults: { public: true }
test.property_info: '@property_info'
framework:
serializer: { enabled: true }
property_info: { enabled: true }

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\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
return [
new FrameworkBundle(),
new TestBundle(),
];

View File

@@ -0,0 +1,7 @@
imports:
- { resource: ./../config/default.yml }
services:
Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller\SubRequestController:
tags:
- { name: controller.service_arguments, action: indexAction, argument: handler, id: fragment.handler }

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 }