diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93dedd5..038ce25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: [ '7.4', '8.0', '8.1' ] - composer: [ '', '--prefer-lowest' ] + php: + - '7.4' + - '8.0' + - '8.1' + - '8.2' + - '8.3' + - '8.4' + deps: + - 'highest' + - 'lowest' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use PHP uses: shivammathur/setup-php@v2 @@ -32,22 +40,22 @@ jobs: - name: cache dependencies id: cache-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.deps }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer- + ${{ runner.os }}-${{ matrix.php }}-${{ matrix.deps }}-composer- - name: Validate composer.json and composer.lock run: composer validate working-directory: ./ - name: Install dependencies - env: - COMPOSER_FLAGS: ${{ matrix.composer }} - run: composer update ${COMPOSER_FLAGS} --prefer-source - working-directory: ./ + uses: ramsey/composer-install@v3 + with: + dependency-versions: '${{ matrix.deps }}' + working-directory: ./ - name: Run Tests diff --git a/Framework/Test/ServiceTestCase.php b/Framework/Test/ServiceTestCase.php index 0702a34..7c753a9 100644 --- a/Framework/Test/ServiceTestCase.php +++ b/Framework/Test/ServiceTestCase.php @@ -94,7 +94,7 @@ static private function getPhpUnitCliConfigArgument() */ static protected function getKernelClass() { - $dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir(); + $dir = $_SERVER['KERNEL_DIR'] ?? static::getPhpUnitXmlDir(); $finder = new Finder(); $finder->name('*Kernel.php')->depth(0)->in($dir); @@ -123,15 +123,15 @@ static protected function getKernelClass() * * @return HttpKernelInterface A HttpKernelInterface instance */ - static protected function createKernel(array $options = array()) + static protected function createKernel(array $options = []) { if (null === static::$class) { static::$class = static::getKernelClass(); } return new static::$class( - isset($options['environment']) ? $options['environment'] : 'test', - isset($options['debug']) ? $options['debug'] : true + $options['environment'] ?? 'test', + $options['debug'] ?? true ); } diff --git a/Tests/TestKernel.php b/Tests/TestKernel.php index 1ae9ddf..feac284 100644 --- a/Tests/TestKernel.php +++ b/Tests/TestKernel.php @@ -11,17 +11,16 @@ public function getRootDir() { return __DIR__.'/Resources'; } - public function registerBundles() + public function registerBundles(): iterable { - return array( - ); + return []; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load(__DIR__.'/Resources/config/config_test.yml'); if (class_exists('Symfony\Component\Asset\Package')) { $loader->load(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', array('assets' => array())); + $container->loadFromExtension('framework', ['assets' => []]); }); } } diff --git a/composer.json b/composer.json index 1a14f30..84aca20 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,14 @@ ], "require": { "php": ">=7.4", - "symfony/http-kernel": "^4.4.12|^5.0", + "symfony/http-kernel": "^4.4.12|^5.0|^6.0", "phpunit/phpunit": "^8.5.23|^9.0" }, "require-dev": { - "symfony/config": "^4.4.12|^5.0", - "symfony/dependency-injection": "^4.4.12|^5.0", - "symfony/yaml": "^4.4.12|^5.0" + "symfony/config": "^4.4.12|^5.0|^6.0", + "symfony/dependency-injection": "^4.4.12|^5.0|^6.0", + "symfony/yaml": "^4.4.12|^5.0|^6.0", + "rector/rector": "^0.19.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e9230a1..ece7173 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,6 @@ - - - - - - - - - - ./Tests - - - - - - - - - - ./ - - ./Tests - ./vendor - ./Resources - - - + bootstrap="Tests/autoload.php" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> + + + ./ + + + ./Tests + ./vendor + ./Resources + + + + + + + + + ./Tests + + + + +