Skip to content

Commit

Permalink
Allow Symfony 7 versions (#22)
Browse files Browse the repository at this point in the history
* Allow Symfony 7 versions

* Define symfony version in CI run

* Fix issue with symfony/symfony#52844

* Skip test when framework extra bundle is not available
  • Loading branch information
alexander-schranz authored Apr 4, 2024
1 parent e2b4b3b commit d42e0ec
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,47 @@ jobs:
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^6.0"

# highest dependencies php 7.4
- php-version: '7.4'
composer-flags: '--prefer-stable --prefer-dist'
lint: true
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^6.0"

# highest dependencies php 8.0
- php-version: '8.0'
composer-flags: '--prefer-stable --prefer-dist'
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^6.0"

# highest dependencies php 8.1
- php-version: '8.1'
composer-flags: '--prefer-stable --prefer-dist'
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^6.0"

# highest dependencies php 8.2
- php-version: '8.2'
composer-flags: '--prefer-stable --prefer-dist'
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^7.0"

# highest dependencies php 8.3
- php-version: '8.3'
composer-flags: '--prefer-stable --prefer-dist'
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY_REQUIRE: "^7.0"

steps:
- name: Checkout project
Expand Down Expand Up @@ -112,6 +118,12 @@ jobs:
./phpunit install
env: ${{ matrix.env }}

- name: Remove sensio/framework-extra-bundle dependency
if: ${{ matrix.env.SYMFONY_REQUIRE == '^7.0' }}
run: |
composer remove sensio/framework-extra-bundle --dev --no-update
env: ${{ matrix.env }}

- name: Fix code style
if: ${{ matrix.lint }}
run: vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
Expand Down
5 changes: 5 additions & 0 deletions Tests/Routing/Loader/RestRouteLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use HandcraftedInTheAlps\RestRoutingBundle\Routing\RestRouteCollection;
use HandcraftedInTheAlps\RestRoutingBundle\Tests\Fixtures\Controller\AnnotatedPrefixedController;
use HandcraftedInTheAlps\RestRoutingBundle\Tests\Fixtures\Controller\UsersController;
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle;

/**
* RestRouteLoader test.
Expand Down Expand Up @@ -425,6 +426,10 @@ public function testOldRequestTypeHintsIgnoredCorrectly()
*/
public function testParamConverterIsIgnoredInRouteGenerationCorrectly()
{
if (!class_exists(SensioFrameworkExtraBundle::class)) {
$this->markTestSkipped('SensioFrameworkExtraBundle is not available');
}

$collection = $this->loadFromControllerFixture('ParamConverterController');

$this->assertNotNull($collection->get('post_something'), 'route for "post_something" does not exist');
Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
"require": {
"php": "^7.2 || ^8.0",
"doctrine/inflector": "^1.4.1|^2.0",
"symfony/config": "^4.4|^5.0|^6.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
"symfony/finder": "^4.4|^5.0|^6.0",
"symfony/framework-bundle": "^4.4.1|^5.0|^6.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0",
"symfony/routing": "^4.4|^5.0|^6.0"
"symfony/config": "^4.4|^5.0|^6.0|^7.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0|^7.0",
"symfony/finder": "^4.4|^5.0|^6.0|^7.0",
"symfony/framework-bundle": "^4.4.1|^5.0|^6.0|^7.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0|^7.0",
"symfony/routing": "^4.4|^5.0|^6.0|^7.0"
},
"require-dev": {
"friendsofsymfony/rest-bundle": "^2.8 || ^3.0",
"sensio/framework-extra-bundle": "^5.2.3 || ^6.0",
"symfony/http-foundation": "^4.4|^5.0|^6.0",
"symfony/phpunit-bridge": "^5.2|^6.0",
"symfony/validator": "^4.4|^5.0|^6.0",
"symfony/serializer": "^4.4|^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0",
"symfony/security-core": "^3.4|^4.3|^5.0|^6.0",
"symfony/http-foundation": "^4.4|^5.0|^6.0|^7.0",
"symfony/phpunit-bridge": "^5.4.33|^6.3.10|^7.0.1",
"symfony/validator": "^4.4|^5.0|^6.0|^7.0",
"symfony/serializer": "^4.4|^5.0|^6.0|^7.0",
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0",
"symfony/security-core": "^3.4|^4.3|^5.0|^6.0|^7.0",
"psr/http-message": "^1.0",
"friendsofphp/php-cs-fixer": "^2.0"
},
Expand Down

0 comments on commit d42e0ec

Please sign in to comment.