Skip to content

Commit

Permalink
Rewrite test config structure & adapt for symfony 5.4 & 6.0 (#291)
Browse files Browse the repository at this point in the history
* Rewrite test config structure & adapt for symfony 5.4 & 6.0

* Run coverage with newest PHP & Symfony

* Run github actions with newest PHP & Symfony
  • Loading branch information
Yann Eugoné committed Dec 15, 2021
1 parent 505d5a7 commit d8e9d6c
Show file tree
Hide file tree
Showing 35 changed files with 252 additions and 163 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ jobs:
include:
- php-version: 7.1
symfony-version: 4.4.*
- php-version: 8.0
- php-version: 8.1
symfony-version: 4.4.*
- php-version: 7.2
symfony-version: 5.3.*
symfony-version: 5.4.*
- php-version: 8.1
symfony-version: 5.4.*
- php-version: 8.0
symfony-version: 5.3.*
symfony-version: 6.0.*
- php-version: 8.1
symfony-version: 6.0.*

steps:
- name: "Checkout"
Expand Down Expand Up @@ -53,8 +57,8 @@ jobs:
strategy:
matrix:
include:
- php-version: 8.0
symfony-version: 5.3.*
- php-version: 8.1
symfony-version: 6.0.*

steps:
- name: "Checkout"
Expand Down Expand Up @@ -92,8 +96,8 @@ jobs:
strategy:
matrix:
include:
- php-version: 8.0
symfony-version: 5.3.*
- php-version: 8.1
symfony-version: 6.0.*

steps:
- name: "Checkout"
Expand Down Expand Up @@ -125,8 +129,8 @@ jobs:
strategy:
matrix:
include:
- php-version: 8.0
symfony-version: 5.3.*
- php-version: 8.1
symfony-version: 6.0.*

steps:
- name: "Checkout"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ framework:
storage_id: session.storage.mock_file
php_errors:
log: true
router:
utf8: true
cache: null
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ framework:
async: 'in-memory://'
routing:
'Presta\SitemapBundle\Messenger\DumpSitemapMessage': async

services:
Presta\SitemapBundle\Tests\Integration\Controller\MessengerController:
tags: ['controller.service_arguments']
3 changes: 3 additions & 0 deletions tests/Integration/config/4.4/routes/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
controllers:
resource: ../../../src/Controller/
type: annotation
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
framework:
test: true
secret: '%env(APP_SECRET)%'
http_method_override: false
session:
Expand All @@ -8,3 +9,6 @@ framework:
storage_factory_id: session.storage.factory.mock_file
php_errors:
log: true
router:
utf8: true
cache: null
6 changes: 6 additions & 0 deletions tests/Integration/config/5.4/messenger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework:
messenger:
transports:
async: 'in-memory://'
routing:
'Presta\SitemapBundle\Messenger\DumpSitemapMessage': async
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
presta_sitemap:
default_section: static
dump_directory: "%kernel.project_dir%/public"
items_by_set: 10
alternate:
enabled: true
default_locale: en
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/config/5.4/routes/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
controllers:
resource: ../../../src/Controller/
type: annotation
2 changes: 2 additions & 0 deletions tests/Integration/config/5.4/routes/presta_sitemap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
presta_sitemap:
resource: "@PrestaSitemapBundle/config/routing.yml"
14 changes: 14 additions & 0 deletions tests/Integration/config/5.4/routes/xml.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="xml" path="/company">
<default key="_controller">Presta\SitemapBundle\Tests\Integration\Controller\StaticController::company</default>
<option key="sitemap">
{"priority":"0.7", "changefreq":"weekly", "section":"static"}
</option>
</route>

</routes>
6 changes: 6 additions & 0 deletions tests/Integration/config/5.4/routes/yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
yaml:
path: /contact
defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::contact }
options:
sitemap:
section: static
14 changes: 14 additions & 0 deletions tests/Integration/config/6.0/framework.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
framework:
test: true
secret: '%env(APP_SECRET)%'
http_method_override: false
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.mock_file
php_errors:
log: true
router:
utf8: true
cache: null
6 changes: 6 additions & 0 deletions tests/Integration/config/6.0/messenger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework:
messenger:
transports:
async: 'in-memory://'
routing:
'Presta\SitemapBundle\Messenger\DumpSitemapMessage': async
9 changes: 9 additions & 0 deletions tests/Integration/config/6.0/presta_sitemap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
presta_sitemap:
default_section: static
dump_directory: "%kernel.project_dir%/public"
items_by_set: 10
alternate:
enabled: true
default_locale: en
locales: [en, fr]
i18n: symfony
3 changes: 3 additions & 0 deletions tests/Integration/config/6.0/routes/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
controllers:
resource: ../../../src/Controller/
type: annotation
2 changes: 2 additions & 0 deletions tests/Integration/config/6.0/routes/presta_sitemap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
presta_sitemap:
resource: "@PrestaSitemapBundle/config/routing.yml"
7 changes: 7 additions & 0 deletions tests/Integration/config/6.0/routes/translated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
about:
path:
en: /about
fr: /a-propos
defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::about }
options:
sitemap: true
14 changes: 14 additions & 0 deletions tests/Integration/config/6.0/routes/xml.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="xml" path="/company">
<default key="_controller">Presta\SitemapBundle\Tests\Integration\Controller\StaticController::company</default>
<option key="sitemap">
{"priority":"0.7", "changefreq":"weekly", "section":"static"}
</option>
</route>

</routes>
6 changes: 6 additions & 0 deletions tests/Integration/config/6.0/routes/yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
yaml:
path: /contact
defaults: { _controller: \Presta\SitemapBundle\Tests\Integration\Controller\StaticController::contact }
options:
sitemap:
section: static
2 changes: 0 additions & 2 deletions tests/Integration/config/packages/cache.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Integration/config/packages/routing.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Integration/config/routes/annotations.yaml

This file was deleted.

1 change: 0 additions & 1 deletion tests/Integration/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ services:

Presta\SitemapBundle\Tests\Integration\Controller\:
resource: '../src/Controller/*'
exclude: '../src/Controller/MessengerController.php'
tags: ['controller.service_arguments']
57 changes: 0 additions & 57 deletions tests/Integration/src/ContainerConfiguratorTrait.php

This file was deleted.

0 comments on commit d8e9d6c

Please sign in to comment.