-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
527 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
colors="true" | ||
bootstrap="tests/Functional/.application/config/bootstrap.php" | ||
convertDeprecationsToExceptions="true" | ||
> | ||
<testsuites> | ||
<testsuite name="twig_extra_tests"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
|
||
<!-- ###+ symfony/framework-bundle ### --> | ||
<env name="APP_DEBUG" value="1"/> | ||
<env name="APP_ENV" value="test"/> | ||
<env name="SHELL_VERBOSITY" value="-1" /> | ||
<!-- ###- symfony/framework-bundle ### --> | ||
|
||
<env name="KERNEL_CLASS" value="TestApplication\Sylius\TwigExtra\Kernel" /> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# In all environments, the following files are loaded if they exist, | ||
# the latter taking precedence over the former: | ||
# | ||
# * .env contains default values for the environment variables needed by the app | ||
# * .env.local uncommitted file with local overrides | ||
# * .env.$APP_ENV committed environment-specific defaults | ||
# * .env.$APP_ENV.local uncommitted environment-specific overrides | ||
# | ||
# Real environment variables win over .env files. | ||
# | ||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. | ||
# https://symfony.com/doc/current/configuration/secrets.html | ||
# | ||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). | ||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration | ||
|
||
###> symfony/framework-bundle ### | ||
APP_ENV=dev | ||
APP_SECRET=c9570eaa5cbfadf33ad1a93f95c2e42a | ||
###< symfony/framework-bundle ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
###> symfony/framework-bundle ### | ||
/.env.local | ||
/.env.local.php | ||
/.env.*.local | ||
/config/secrets/prod/prod.decrypt.private.php | ||
/public/bundles/ | ||
/var/ | ||
/vendor/ | ||
###< symfony/framework-bundle ### | ||
|
||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
use TestApplication\Sylius\TwigExtra\Kernel; | ||
|
||
$_SERVER['APP_RUNTIME_OPTIONS'] = [ | ||
'project_dir' => dirname(__DIR__), | ||
]; | ||
|
||
if (file_exists(dirname(__DIR__).'/vendor/autoload_runtime.php')) { | ||
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php'; | ||
} elseif (file_exists(dirname(__DIR__, 4).'/vendor/autoload_runtime.php')) { | ||
require_once dirname(__DIR__, 4).'/vendor/autoload_runtime.php'; | ||
} else { | ||
require_once dirname(__DIR__, 6).'/vendor/autoload_runtime.php'; | ||
} | ||
|
||
return function (array $context) { | ||
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); | ||
|
||
return new Application($kernel); | ||
}; |
38 changes: 38 additions & 0 deletions
38
src/TwigExtra/tests/Functional/.application/config/bootstrap.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) { | ||
require_once dirname(__DIR__) . '/vendor/autoload.php'; | ||
} elseif (file_exists(dirname(__DIR__, 4) . '/vendor/autoload.php')) { | ||
require_once dirname(__DIR__, 4) . '/vendor/autoload.php'; | ||
} else { | ||
require_once dirname(__DIR__, 6) . '/vendor/autoload.php'; | ||
} | ||
|
||
// Load cached env vars if the .env.local.php file exists | ||
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) | ||
if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { | ||
$_SERVER += $env; | ||
$_ENV += $env; | ||
} elseif (!class_exists(Dotenv::class)) { | ||
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); | ||
} else { | ||
// load all the .env files | ||
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env'); | ||
} | ||
|
||
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; | ||
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; | ||
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; |
19 changes: 19 additions & 0 deletions
19
src/TwigExtra/tests/Functional/.application/config/bundles.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], | ||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], | ||
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], | ||
Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], | ||
]; |
19 changes: 19 additions & 0 deletions
19
src/TwigExtra/tests/Functional/.application/config/packages/cache.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
framework: | ||
cache: | ||
# Unique name of your app: used to compute stable namespaces for cache keys. | ||
#prefix_seed: your_vendor_name/app_name | ||
|
||
# The "app" cache stores to the filesystem by default. | ||
# The data in this cache should persist between deploys. | ||
# Other options include: | ||
|
||
# Redis | ||
#app: cache.adapter.redis | ||
#default_redis_provider: redis://localhost | ||
|
||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) | ||
#app: cache.adapter.apcu | ||
|
||
# Namespaced pools use the above "app" backend by default | ||
#pools: | ||
#my.dedicated.cache: null |
24 changes: 24 additions & 0 deletions
24
src/TwigExtra/tests/Functional/.application/config/packages/framework.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
use Symfony\Component\HttpKernel\Kernel; | ||
|
||
return static function (ContainerConfigurator $container): void { | ||
if (Kernel::MAJOR_VERSION >= 6) { | ||
$container->extension('framework', [ | ||
'handle_all_throwables' => true, | ||
]); | ||
} | ||
}; |
22 changes: 22 additions & 0 deletions
22
src/TwigExtra/tests/Functional/.application/config/packages/framework.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# see https://symfony.com/doc/current/reference/configuration/framework.html | ||
framework: | ||
secret: '%env(APP_SECRET)%' | ||
#csrf_protection: true | ||
http_method_override: false | ||
|
||
# Enables session support. Note that the session will ONLY be started if you read or write from it. | ||
# Remove or comment this section to explicitly disable session support. | ||
session: | ||
handler_id: null | ||
cookie_secure: auto | ||
cookie_samesite: lax | ||
storage_factory_id: session.storage.factory.native | ||
|
||
#esi: true | ||
#fragments: true | ||
|
||
when@test: | ||
framework: | ||
test: true | ||
session: | ||
storage_factory_id: session.storage.factory.mock_file |
12 changes: 12 additions & 0 deletions
12
src/TwigExtra/tests/Functional/.application/config/packages/routing.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
framework: | ||
router: | ||
utf8: true | ||
|
||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands. | ||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands | ||
#default_uri: http://localhost | ||
|
||
when@prod: | ||
framework: | ||
router: | ||
strict_requirements: null |
16 changes: 16 additions & 0 deletions
16
src/TwigExtra/tests/Functional/.application/config/preload.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) { | ||
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php'; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/TwigExtra/tests/Functional/.application/config/routes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#index: | ||
# path: / | ||
# controller: App\Controller\DefaultController::index | ||
|
||
test_html_attribute: | ||
path: /test_html_attribute | ||
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController | ||
defaults: | ||
template: 'test_html_attribute.html.twig' | ||
|
||
route_exists: | ||
path: /route_exists | ||
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController | ||
defaults: | ||
template: 'route_exists.html.twig' | ||
|
||
sort_by: | ||
path: /sort_by | ||
controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController | ||
defaults: | ||
template: 'sort_by.html.twig' |
4 changes: 4 additions & 0 deletions
4
src/TwigExtra/tests/Functional/.application/config/routes/framework.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
when@dev: | ||
_errors: | ||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml' | ||
prefix: /_error |
24 changes: 24 additions & 0 deletions
24
src/TwigExtra/tests/Functional/.application/config/services.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This file is the entry point to configure your own services. | ||
# Files in the packages/ subdirectory configure your dependencies. | ||
|
||
# Put parameters here that don't need to change on each machine where the app is deployed | ||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration | ||
parameters: | ||
|
||
services: | ||
# default configuration for services in *this* file | ||
_defaults: | ||
autowire: true # Automatically injects dependencies in your services. | ||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. | ||
|
||
# makes classes in src/ available to be used as services | ||
# this creates a service per class whose id is the fully-qualified class name | ||
TestApplication\Sylius\TwigExtra\: | ||
resource: '../src/' | ||
exclude: | ||
- '../src/DependencyInjection/' | ||
- '../src/Entity/' | ||
- '../src/Kernel.php' | ||
|
||
# add more service definitions when explicit configuration is needed | ||
# please note that last definitions always *replace* previous ones |
26 changes: 26 additions & 0 deletions
26
src/TwigExtra/tests/Functional/.application/public/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use TestApplication\Sylius\TwigExtra\Kernel; | ||
|
||
if (file_exists(dirname(__DIR__) . '/vendor/autoload_runtime.php')) { | ||
require_once dirname(__DIR__) . '/vendor/autoload_runtime.php'; | ||
} elseif (file_exists(dirname(__DIR__, 4) . '/vendor/autoload_runtime.php')) { | ||
require_once dirname(__DIR__, 4) . '/vendor/autoload_runtime.php'; | ||
} else { | ||
require_once dirname(__DIR__, 6) . '/vendor/autoload_runtime.php'; | ||
} | ||
|
||
return function (array $context) { | ||
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); | ||
}; |
Empty file.
Oops, something went wrong.