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

Allow Symfony 6 #323

Merged
merged 4 commits into from
Dec 2, 2021
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
17 changes: 11 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
continue-on-error: ${{ matrix.allowed-to-fail }}

strategy:
matrix:
matrix:
php-version: ['7.2.5', '7.3', '7.4', '8.0']
variant: [normal]
dependencies: [highest]
Expand All @@ -46,6 +46,11 @@ jobs:
variant: 'symfony/symfony:"5.1"'
allowed-to-fail: false
symfony-version: 5.1
- php-version: '8.0'
dependencies: highest
variant: 'symfony/symfony:"6.0.*"'
allowed-to-fail: false
symfony-version: 6.0
steps:
- name: "Checkout code"
uses: actions/checkout@v2.3.3
Expand All @@ -65,12 +70,12 @@ jobs:
- name: Install variant
if: matrix.variant != 'normal'
run: composer require ${{ matrix.variant }} --no-update

- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"
composer-options: "--prefer-dist"

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

- name: "Run unit tests"
run: vendor/bin/phpunit --coverage-text --verbose
- name: "Run phantomjs tests"

- name: "Run phantomjs tests"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html

- name: "Run phantomjs tests ES5"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index-with-es5-shim.html
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
vendor/
composer.lock
.phpunit.result.cache
2 changes: 1 addition & 1 deletion Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
}

/**
* {@inheritDoc}
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
Expand Down
10 changes: 5 additions & 5 deletions Tests/Fixtures/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct($environment, $debug)
parent::__construct($environment, $debug);
}

public function registerBundles()
public function registerBundles(): iterable
{
return array(
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
Expand All @@ -44,22 +44,22 @@ public function registerBundles()
);
}

public function getRootDir()
public function getRootDir(): string
{
return __DIR__;
}

public function getProjectDir()
public function getProjectDir(): string
{
return __DIR__.'/../';
}

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

public function getLogDir()
public function getLogDir(): string
{
return sys_get_temp_dir().'/'.Kernel::VERSION.'/bazinga-js-translation/logs';
}
Expand Down
5 changes: 3 additions & 2 deletions Tests/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Bazinga\Bundle\JsTranslationBundle\Tests\Fixtures\app\AppKernel;

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

protected static function getKernelClass()
protected static function getKernelClass(): string
{
return AppKernel::class;
}

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

Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
],
"require": {
"php": ">=7.2.5",
"symfony/framework-bundle": "~4.4|~5.0",
"symfony/finder": "~4.4|~5.0",
"symfony/console": "~4.4|~5.0",
"symfony/intl": "~4.4|~5.0",
"symfony/translation": "~4.4|~5.0",
"symfony/twig-bundle": "~4.4|~5.0"
"symfony/framework-bundle": "~4.4|~5.0|~6.0",
"symfony/finder": "~4.4|~5.0|~6.0",
"symfony/console": "~4.4|~5.0|~6.0",
"symfony/intl": "~4.4|~5.0|~6.0",
"symfony/translation": "~4.4|~5.0|~6.0",
"symfony/twig-bundle": "~4.4|~5.0|~6.0"
},
"require-dev": {
"symfony/asset": "~4.4|~5.0",
"symfony/filesystem": "~4.4|~5.0",
"symfony/yaml": "~4.4|~5.0",
"symfony/browser-kit": "~4.4|~5.0",
"symfony/twig-bundle": "~4.4|~5.0",
"symfony/phpunit-bridge": "^5.0",
"symfony/asset": "~4.4|~5.0|~6.0",
"symfony/filesystem": "~4.4|~5.0|~6.0",
"symfony/yaml": "~4.4|~5.0|~6.0",
"symfony/browser-kit": "~4.4|~5.0|~6.0",
"symfony/twig-bundle": "~4.4|~5.0|~6.0",
"symfony/phpunit-bridge": "^5.0|^6.0",
"phpunit/phpunit": "^4.8|~5.7|~6.5|~8"
},
"replace": {
Expand Down
6 changes: 6 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
</php>
</phpunit>