Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance 3.x testing #282

Merged
merged 9 commits into from
Jun 28, 2021
14 changes: 9 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/.github export-ignore
/Tests export-ignore
/.gitignore export-ignore
/Makefile export-ignore
/phpunit.xml.dist export-ignore
/.github export-ignore
/doc/ export-ignore
/tests/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
include:
- php-version: 7.1
symfony-version: 4.4.*
- php-version: 7.4
- php-version: 8.0
yann-eugone marked this conversation as resolved.
Show resolved Hide resolved
symfony-version: 4.4.*
- php-version: 7.2
symfony-version: 5.2.*
- php-version: 7.4
symfony-version: 5.2.*
symfony-version: 5.3.*
- php-version: 8.0
symfony-version: 5.3.*

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

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

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

steps:
- name: "Checkout"
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"require-dev": {
"doctrine/annotations": "^1.0",
"phpstan/phpstan": "^0.12.82",
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "^7.5|^8.0",
"sensio/framework-extra-bundle": "^5.5|^6.1",
"squizlabs/php_codesniffer": "^3.5",
"symfony/messenger": "^4.4|^5.0",
"symfony/browser-kit": "^4.4|^5.0",
Expand All @@ -38,7 +39,8 @@
"psr-4": {
"Presta\\SitemapBundle\\Tests\\Unit\\": "tests/Unit",
"Presta\\SitemapBundle\\Tests\\Integration\\Tests\\": "tests/Integration/tests",
"Presta\\SitemapBundle\\Tests\\Integration\\": "tests/Integration/src"
"Presta\\SitemapBundle\\Tests\\Integration\\": "tests/Integration/src",
"Presta\\SitemapBundle\\Tests\\Standards\\": "tests/Standards"
}
},
"extra": {
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<testsuite name="Integration">
<directory suffix="Test.php">./tests/Integration/tests</directory>
</testsuite>
<testsuite name="Standards">
<directory suffix="Test.php">./tests/Standards</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
Expand Down
6 changes: 2 additions & 4 deletions src/Command/DumpSitemapsCommand.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -22,8 +22,6 @@

/**
* Command to dump the sitemaps to provided directory
*
* @author Konstantin Tjuterev <kostik.lv@gmail.com>
*/
class DumpSitemapsCommand extends Command
{
Expand Down
6 changes: 2 additions & 4 deletions src/Controller/SitemapController.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,8 +17,6 @@

/**
* Provides action to render sitemap files
*
* @author David Epely <depely@prestaconcept.net>
*/
class SitemapController
{
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -18,7 +18,7 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* This is the class that validates and merges configuration from your app/config files
* Bundle configuration structure.
*/
class Configuration implements ConfigurationInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/DependencyInjection/PrestaSitemapExtension.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -18,7 +18,7 @@
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;

/**
* This is the class that loads and manages your bundle configuration
* Load Bundle configuration, configure container parameters & services.
*/
class PrestaSitemapExtension extends Extension
{
Expand Down
10 changes: 7 additions & 3 deletions src/Event/SitemapAddUrlEvent.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -15,7 +15,11 @@
use Symfony\Contracts\EventDispatcher\Event;

/**
* Event to allow generation of static routes sitemap urls.
* Event called whenever a static url is about to be added to sitemap.
*
* Subscribe to this event if :
* - you want to decorate Url
* - you want to prevent Url from being added
*/
class SitemapAddUrlEvent extends Event
{
Expand Down
9 changes: 5 additions & 4 deletions src/Event/SitemapPopulateEvent.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -15,9 +15,10 @@
use Symfony\Contracts\EventDispatcher\Event;

/**
* Manage populate event
* Event called whenever a sitemap build is requested.
*
* @author depely
* Subscribe to this event if :
* - you want to register non-static routes
*/
class SitemapPopulateEvent extends Event
{
Expand Down
7 changes: 4 additions & 3 deletions src/EventListener/RouteAnnotationEventListener.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -23,7 +23,8 @@
use Symfony\Component\Routing\RouterInterface;

/**
* This listener iterate over configured routes, and register allowed URLs to sitemap.
* Listen to "presta_sitemap.populate" event.
* Populate sitemap with configured static routes.
*/
class RouteAnnotationEventListener implements EventSubscriberInterface
{
Expand Down
14 changes: 14 additions & 0 deletions src/EventListener/StaticRoutesAlternateEventListener.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Presta\SitemapBundle\EventListener;

use Presta\SitemapBundle\Event\SitemapAddUrlEvent;
Expand All @@ -8,6 +17,11 @@
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

/**
* Listen to "presta_sitemap.add_url" event.
* Decorate translatable Url with multi-lang alternatives.
* Support both Symfony translated routes & JMSI18nRoutingBundle.
*/
final class StaticRoutesAlternateEventListener implements EventSubscriberInterface
{
private const TRANSLATED_ROUTE_NAME_STRATEGIES = [
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/Exception.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,8 +13,6 @@

/**
* Base Exception for Sitemap
*
* @author David Epely <depely@prestaconcept.net>
*/
class Exception extends \RuntimeException
{
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/GoogleImageException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,8 +13,6 @@

/**
* Exception used when limit is reached on adding images
*
* @author David Epely <depely@prestaconcept.net>
*/
class GoogleImageException extends Exception
{
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/GoogleNewsUrlException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,8 +13,6 @@

/**
* Exception used when some limits are reached in a news url.
*
* @author Christoph Foehrdes
*/
class GoogleNewsUrlException extends Exception
{
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/GoogleVideoException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,8 +13,6 @@

/**
* Exception used when limit is reached on adding video
*
* @author David Epely <depely@prestaconcept.net>
*/
class GoogleVideoException extends Exception
{
Expand Down
6 changes: 2 additions & 4 deletions src/Exception/GoogleVideoTagException.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
/*
* This file is part of the PrestaSitemapBundle package.
*
* (c) PrestaConcept <www.prestaconcept.net>
* (c) PrestaConcept <https://prestaconcept.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,8 +13,6 @@

/**
* Exception used when limit is reached on adding tag to video
*
* @author David Epely <depely@prestaconcept.net>
*/
class GoogleVideoTagException extends Exception
{
Expand Down
Loading