Skip to content

Commit

Permalink
Update dependencies for PHP 8.1 and Symfony 6.* (#27)
Browse files Browse the repository at this point in the history
* update deps for php 8.* and symfony 6.*
  • Loading branch information
gwinn authored Oct 26, 2023
1 parent e17d2d8 commit 4ce1969
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 24 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ jobs:
matrix:
php-version:
- '7.4'
- '8.1'
symfony-version:
- '4.4.*'
- '5.4.*'
- '6.2.*'
exclude:
- php-version: '8.1'
symfony-version: '4.4.*'
- php-version: '8.1'
symfony-version: '5.4.*'
- php-version: '7.4'
symfony-version: '6.2.*'
coverage: [ 'none' ]
steps:
- name: "Checkout"
Expand Down Expand Up @@ -47,6 +56,7 @@ jobs:
php-version:
- '7.4'
- '8.0'
- '8.1'
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand Down
42 changes: 21 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@
}],
"require": {
"php": ">=7.4",
"symfony/framework-bundle" : "^4.0|^5.0",
"symfony/yaml": "^4.0|^5.0"
"symfony/framework-bundle" : "^4.0|^5.0|^6.0",
"symfony/yaml": "^4.0|^5.0|^6.0"
},
"require-dev": {
"nyholm/symfony-bundle-test": "^2.0",
"phpunit/phpunit": "^8.5",
"symfony/phpunit-bridge": "^5.0",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0",
"symfony/error-handler": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/deprecation-contracts": "^1.1|^2.0",
"symfony/event-dispatcher-contracts": "^1.1|^2.0",
"symfony/routing": "^4.4|^5.0",
"symfony/finder": "^4.4|^5.0",
"symfony/filesystem": "^4.4|^5.0",
"phpunit/phpunit": "^8.5|^9.5",
"symfony/phpunit-bridge": "^5.0|^6.0",
"symfony/config": "^4.4|^5.0|^6.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
"symfony/event-dispatcher": "^4.4|^5.0|^6.0",
"symfony/error-handler": "^4.4|^5.0|^6.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0",
"symfony/http-foundation": "^4.4|^5.0|^6.0",
"symfony/deprecation-contracts": "^1.1|^2.0|^3",
"symfony/event-dispatcher-contracts": "^1.1|^2.0|^3",
"symfony/routing": "^4.4|^5.0|^6.0",
"symfony/finder": "^4.4|^5.0|^6.0",
"symfony/filesystem": "^4.4|^5.0|^6.0",
"symfony/translation-contracts": "^1.1|^2.0",
"symfony/var-exporter": "^4.4|^5.0",
"symfony/var-dumper": "^4.4|^5.0",
"psr/log": "~1.0",
"symfony/var-exporter": "^4.4|^5.0|^6.0",
"symfony/var-dumper": "^4.4|^5.0|^6.0",
"psr/log": "~1.0|^2|^3",
"friendsofphp/php-cs-fixer": "3.4",
"twig/twig": "^v2.14",
"symfony/twig-bundle": "^4.4|^5.0",
"symfony/twig-bridge": "^4.4|^5.0"
"twig/twig": "^v2.14 || ^3.0",
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
"symfony/twig-bridge": "^4.4|^5.0|^6.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<php>
<ini name="error_reporting" value="-1" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="[self]=0" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled=1" />
<env name="USE_EXPERIMENTAL_EXECUTOR" value="0" />
</php>
<listeners>
Expand Down
23 changes: 21 additions & 2 deletions tests/BundleInitializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ protected static function createKernel(array $options = []): KernelInterface
public function testInitBundle(): void
{
self::bootKernel();
$container = self::$container;
$symfony = self::getSymfonyVersion();

if (version_compare($symfony, '5.0.0') >= 0) {
$container = self::getContainer();
} else {
$container = self::$container;
}

$this->assertTrue($container->has(Stopwatch::class));
$this->assertTrue($container->has('intaro_pinba.stopwatch'));
Expand All @@ -44,9 +50,22 @@ public function testInitBundle(): void
public function testTwigRenderStopwatch(): void
{
self::bootKernel();
$container = self::$container;
$symfony = self::getSymfonyVersion();

if (version_compare($symfony, '5.0.0') >= 0) {
$container = self::getContainer();
} else {
$container = self::$container;
}

$service = $container->get('twig');
$this->assertInstanceOf(TimedTwigEnvironment::class, $service);
}

private static function getSymfonyVersion()
{
$kernel = self::bootKernel();

return $kernel::VERSION;
}
}

0 comments on commit 4ce1969

Please sign in to comment.