Skip to content

Commit

Permalink
feature #41 Allow Symfony 6 (chalasr)
Browse files Browse the repository at this point in the history
This PR was merged into the main branch.

Discussion
----------

Allow Symfony 6

Commits
-------

b9ced6b Allow Symfony 6
  • Loading branch information
derrabus committed Feb 4, 2022
2 parents 5d1ea35 + b9ced6b commit a1068ab
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ jobs:
deps: lowest
symfony: '^4.4'

# Test latest php with LTS versions
# Test LTS versions
- php: 8.0
deps: stable
symfony: '^4.4'

# Test latest php/Symfony
- php: 8.1
deps: stable
symfony: '^6.0'

steps:
- name: Checkout code
uses: 'actions/checkout@v2'
Expand All @@ -44,6 +49,9 @@ jobs:
- name: Configure Symfony version
run: 'echo SYMFONY_REQUIRE="${{ matrix.symfony }}" >> $GITHUB_ENV'

- name: Allow dev dependencies
run: 'composer config minimum-stability dev'

- name: Composer install
uses: 'ramsey/composer-install@v1'
with:
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"require": {
"php": ">=7.2.9",
"ext-xml": "*",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0",
"symfony/security-acl": "^3.0",
"symfony/security-bundle": "^4.4|^5.0"
"symfony/security-bundle": "^4.4|^5.0|^6.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/dbal": "^2.13.1|^3.1",
"doctrine/orm": "^2.7.3",
"symfony/console": "^4.4|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/phpunit-bridge": "^5.0",
"symfony/yaml": "^4.4|^5.0"
"symfony/console": "^4.4|^5.0|^6.0",
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
"symfony/phpunit-bridge": "^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0"
},
"suggest": {
"doctrine/doctrine-bundle": "To use the default dbal configuration"
Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/Fixtures/php/cache_pool.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$this->load('container1.php', $container);
$this->load('container1.php', 'php');

$container->loadFromExtension('acl', [
'cache' => [
Expand Down
8 changes: 6 additions & 2 deletions tests/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@

use Symfony\Bundle\AclBundle\Tests\Functional\app\AppKernel;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpKernel\KernelInterface;

class FunctionalTestCase extends KernelTestCase
{
protected static function getKernelClass()
/**
* @return class-string<KernelInterface>
*/
protected static function getKernelClass(): string
{
return AppKernel::class;
}

protected static function createKernel(array $options = [])
protected static function createKernel(array $options = []): KernelInterface
{
$class = self::getKernelClass();

Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct($testCase, $rootConfig, $environment, $debug)
parent::__construct($environment, $debug);
}

public function registerBundles()
public function registerBundles(): iterable
{
if (!is_file($filename = $this->getRootDir().'/'.$this->testCase.'/bundles.php')) {
throw new \RuntimeException(sprintf('The bundles file "%s" does not exist.', $filename));
Expand All @@ -55,12 +55,12 @@ public function getRootDir()
return __DIR__;
}

public function getCacheDir()
public function getCacheDir(): string
{
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/cache/'.$this->environment;
}

public function getLogDir()
public function getLogDir(): string
{
return sys_get_temp_dir().'/'.Kernel::VERSION.'/'.$this->testCase.'/logs';
}
Expand All @@ -81,7 +81,7 @@ public function unserialize($str)
$this->__construct($a[0], $a[1], $a[2], $a[3]);
}

protected function getKernelParameters()
protected function getKernelParameters(): array
{
$parameters = parent::getKernelParameters();
$parameters['kernel.test_case'] = $this->testCase;
Expand Down

0 comments on commit a1068ab

Please sign in to comment.