diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2f5b3d4d..b141ada2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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] @@ -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 @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index e96cdacf..944eac06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules vendor/ composer.lock +.phpunit.result.cache diff --git a/Command/DumpCommand.php b/Command/DumpCommand.php index efcedd2e..bd3f2ae0 100644 --- a/Command/DumpCommand.php +++ b/Command/DumpCommand.php @@ -90,7 +90,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) } /** - * {@inheritDoc} + * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { diff --git a/Tests/Fixtures/app/AppKernel.php b/Tests/Fixtures/app/AppKernel.php index a9661f78..2ff1e5fb 100644 --- a/Tests/Fixtures/app/AppKernel.php +++ b/Tests/Fixtures/app/AppKernel.php @@ -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(), @@ -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'; } diff --git a/Tests/WebTestCase.php b/Tests/WebTestCase.php index d3031064..7b1248c0 100644 --- a/Tests/WebTestCase.php +++ b/Tests/WebTestCase.php @@ -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 @@ -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(); diff --git a/composer.json b/composer.json index 394f10c7..dbde169d 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 225fccf7..3ba62515 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -23,4 +23,10 @@ + + + + + +