Skip to content

Commit 811fff5

Browse files
authored
Allow Symfony 6 (#323)
1 parent 0388881 commit 811fff5

7 files changed

Lines changed: 39 additions & 26 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
continue-on-error: ${{ matrix.allowed-to-fail }}
2020

2121
strategy:
22-
matrix:
22+
matrix:
2323
php-version: ['7.2.5', '7.3', '7.4', '8.0']
2424
variant: [normal]
2525
dependencies: [highest]
@@ -46,6 +46,11 @@ jobs:
4646
variant: 'symfony/symfony:"5.1"'
4747
allowed-to-fail: false
4848
symfony-version: 5.1
49+
- php-version: '8.0'
50+
dependencies: highest
51+
variant: 'symfony/symfony:"6.0.*"'
52+
allowed-to-fail: false
53+
symfony-version: 6.0
4954
steps:
5055
- name: "Checkout code"
5156
uses: actions/checkout@v2.3.3
@@ -65,12 +70,12 @@ jobs:
6570
- name: Install variant
6671
if: matrix.variant != 'normal'
6772
run: composer require ${{ matrix.variant }} --no-update
68-
73+
6974
- name: "Install Composer dependencies (${{ matrix.dependencies }})"
7075
uses: "ramsey/composer-install@v1"
7176
with:
7277
dependency-versions: "${{ matrix.dependencies }}"
73-
composer-options: "--prefer-dist"
78+
composer-options: "--prefer-dist"
7479

7580
- name: "Install PHPUnit"
7681
run: vendor/bin/simple-phpunit install
@@ -80,9 +85,9 @@ jobs:
8085

8186
- name: "Run unit tests"
8287
run: vendor/bin/phpunit --coverage-text --verbose
83-
84-
- name: "Run phantomjs tests"
88+
89+
- name: "Run phantomjs tests"
8590
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html
86-
91+
8792
- name: "Run phantomjs tests ES5"
8893
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index-with-es5-shim.html

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
vendor/
33
composer.lock
4+
.phpunit.result.cache

Command/DumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
9090
}
9191

9292
/**
93-
* {@inheritDoc}
93+
* @return int
9494
*/
9595
protected function execute(InputInterface $input, OutputInterface $output)
9696
{

Tests/Fixtures/app/AppKernel.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($environment, $debug)
3434
parent::__construct($environment, $debug);
3535
}
3636

37-
public function registerBundles()
37+
public function registerBundles(): iterable
3838
{
3939
return array(
4040
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
@@ -44,22 +44,22 @@ public function registerBundles()
4444
);
4545
}
4646

47-
public function getRootDir()
47+
public function getRootDir(): string
4848
{
4949
return __DIR__;
5050
}
5151

52-
public function getProjectDir()
52+
public function getProjectDir(): string
5353
{
5454
return __DIR__.'/../';
5555
}
5656

57-
public function getCacheDir()
57+
public function getCacheDir(): string
5858
{
5959
return sys_get_temp_dir().'/'.Kernel::VERSION.'/bazinga-js-translation/cache/'.$this->environment;
6060
}
6161

62-
public function getLogDir()
62+
public function getLogDir(): string
6363
{
6464
return sys_get_temp_dir().'/'.Kernel::VERSION.'/bazinga-js-translation/logs';
6565
}

Tests/WebTestCase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\DependencyInjection\ContainerInterface;
77
use Symfony\Component\Filesystem\Filesystem;
88
use Symfony\Component\HttpKernel\Kernel;
9+
use Symfony\Component\HttpKernel\KernelInterface;
910
use Bazinga\Bundle\JsTranslationBundle\Tests\Fixtures\app\AppKernel;
1011

1112
abstract class WebTestCase extends BaseWebTestCase
@@ -30,12 +31,12 @@ protected static function getContainer(): ContainerInterface
3031
return static::$kernel->getContainer();
3132
}
3233

33-
protected static function getKernelClass()
34+
protected static function getKernelClass(): string
3435
{
3536
return AppKernel::class;
3637
}
3738

38-
protected static function createKernel(array $options = array())
39+
protected static function createKernel(array $options = array()): KernelInterface
3940
{
4041
$class = self::getKernelClass();
4142

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
],
1313
"require": {
1414
"php": ">=7.2.5",
15-
"symfony/framework-bundle": "~4.4|~5.0",
16-
"symfony/finder": "~4.4|~5.0",
17-
"symfony/console": "~4.4|~5.0",
18-
"symfony/intl": "~4.4|~5.0",
19-
"symfony/translation": "~4.4|~5.0",
20-
"symfony/twig-bundle": "~4.4|~5.0"
15+
"symfony/framework-bundle": "~4.4|~5.0|~6.0",
16+
"symfony/finder": "~4.4|~5.0|~6.0",
17+
"symfony/console": "~4.4|~5.0|~6.0",
18+
"symfony/intl": "~4.4|~5.0|~6.0",
19+
"symfony/translation": "~4.4|~5.0|~6.0",
20+
"symfony/twig-bundle": "~4.4|~5.0|~6.0"
2121
},
2222
"require-dev": {
23-
"symfony/asset": "~4.4|~5.0",
24-
"symfony/filesystem": "~4.4|~5.0",
25-
"symfony/yaml": "~4.4|~5.0",
26-
"symfony/browser-kit": "~4.4|~5.0",
27-
"symfony/twig-bundle": "~4.4|~5.0",
28-
"symfony/phpunit-bridge": "^5.0",
23+
"symfony/asset": "~4.4|~5.0|~6.0",
24+
"symfony/filesystem": "~4.4|~5.0|~6.0",
25+
"symfony/yaml": "~4.4|~5.0|~6.0",
26+
"symfony/browser-kit": "~4.4|~5.0|~6.0",
27+
"symfony/twig-bundle": "~4.4|~5.0|~6.0",
28+
"symfony/phpunit-bridge": "^5.0|^6.0",
2929
"phpunit/phpunit": "^4.8|~5.7|~6.5|~8"
3030
},
3131
"replace": {

phpunit.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@
2323
</exclude>
2424
</whitelist>
2525
</filter>
26+
<listeners>
27+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
28+
</listeners>
29+
<php>
30+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
31+
</php>
2632
</phpunit>

0 commit comments

Comments
 (0)