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

Update test matrix and dependencies to use supported Symfony versions only #38

Merged
merged 6 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ jobs:
fail-fast: false
matrix:
include:
- { php-version: 7.2, symfony-locked-version: none, dependency-version: prefer-lowest }
- { php-version: 7.4, symfony-locked-version: 5.3.*, dependency-version: prefer-stable }
- { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-stable }
- { php-version: 8.2, symfony-locked-version: none, dependency-version: prefer-stable }
- { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-lowest }
- { php-version: 8.1, symfony-locked-version: 5.4.*, dependency-version: prefer-stable }
- { php-version: 8.2, symfony-locked-version: 6.4.*, dependency-version: prefer-stable }
- { php-version: 8.3, symfony-locked-version: none, dependency-version: prefer-stable }
name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }})
steps:
Expand Down
29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,30 @@
"license": "MIT",

"require": {
"php": ">=7.2",
"php": ">=8.1",
"ext-json": "*",
"ext-mbstring": "*",
"psr/log": "^1.0.2",
"symfony/config": "^4.4|^5.0|^6.0|^7.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0|^7.0",
"symfony/config": "^5.4|^6.0|^7.0",
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/form": "^4.4|^5.0|^6.0|^7.0",
"symfony/http-foundation": "^5.3|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0|^7.0",
"symfony/form": "^5.4|^6.0|^7.0",
"symfony/http-foundation": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"thunderer/shortcode": "^0.6.5|^0.7",
"twig/twig": "^1.34|^2.0|^3.0"
"twig/twig": "^2.0|^3.0"
},

"require-dev": {
"phpunit/phpunit": "^8.5|^9.5",
"symfony/browser-kit": "^4.4|^5.4|^6.0|^7.0",
"symfony/expression-language": "^4.4|^5.0|^6.0|^7.0",
"symfony/framework-bundle": "^5.3|^6.0|^7.0",
"phpunit/phpunit": "^10.5",
"symfony/browser-kit": "^5.4|^6.0|^7.0",
"symfony/error-handler": "^5.4|^6.0|^7.1",
"symfony/expression-language": "^5.4|^6.0|^7.0",
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
"symfony/phpunit-bridge": ">= 6.0",
"symfony/routing": "^4.4|^5.0|^6.0|^7.0",
"symfony/twig-bundle": "^4.4|^5.0|^6.0|^7.0",
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0"
"symfony/routing": "^5.4|^6.0|^7.0",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/yaml": "^5.4|^6.0|^7.0"
},

"autoload": {
Expand Down
18 changes: 5 additions & 13 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd"
bootstrap="vendor/autoload.php">

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="tests/bootstrap.php" cacheDirectory=".phpunit.cache">
<php>
<env name="SHELL_VERBOSITY" value="-1" />
<server name="KERNEL_CLASS" value="\Webfactory\ShortcodeBundle\Tests\Fixtures\TestKernel" />
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=9999" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
<exclude>tests/Functional/ShortcodeTest.php</exclude>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>

</phpunit>
2 changes: 1 addition & 1 deletion src/DependencyInjection/Compiler/ShortcodeCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class ShortcodeCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$shortcodeServices = $container->findTaggedServiceIds('webfactory.shortcode');

Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/WebfactoryShortcodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
final class WebfactoryShortcodeExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('shortcodes.xml');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function tagged_services_are_added_as_handlers_to_handler_container(): vo
->with('add', $this->callback(function (array $argument) {
static $count = 0;
++$count;

return 'shortcode'.$count === $argument[0] && $argument[1] instanceof Reference;
}));

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function registerBundles(): array
];
}

public function registerContainerConfiguration(LoaderInterface $loader)
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yml');
$loader->load(__DIR__.'/config/test_shortcodes.xml');
Expand Down
7 changes: 7 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Symfony\Component\ErrorHandler\DebugClassLoader;

require_once __DIR__.'/../vendor/autoload.php';

DebugClassLoader::enable();