Skip to content

Commit

Permalink
Fix Symfony 6.1 deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
norkunas committed Jun 7, 2022
1 parent 22eb70f commit d4e6150
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
symfony-version: 6.0.*
- php-version: 8.1
symfony-version: 6.0.*
- php-version: 8.1
symfony-version: 6.1.*

steps:
- name: "Checkout"
Expand Down
9 changes: 6 additions & 3 deletions src/Command/DumpSitemapsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
*/
class DumpSitemapsCommand extends Command
{
protected static $defaultName = 'presta:sitemaps:dump';

/**
* @var RouterInterface
*/
Expand All @@ -48,7 +46,12 @@ public function __construct(RouterInterface $router, DumperInterface $dumper, st
$this->dumper = $dumper;
$this->defaultTarget = $defaultTarget;

parent::__construct(null);
parent::__construct();
}

public static function getDefaultName(): ?string
{
return 'presta:sitemaps:dump';
}

/**
Expand Down
14 changes: 14 additions & 0 deletions tests/Integration/config/6.1/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.1/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.1/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.1/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.1/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.1/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.1/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.1/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

0 comments on commit d4e6150

Please sign in to comment.