Skip to content

Commit

Permalink
Fix the dependencies and tests for Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeorget committed Jan 15, 2022
1 parent cf87f9e commit 85de116
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 225 deletions.
23 changes: 15 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,35 @@ env:
- SYMFONY_DEPRECATIONS_HELPER="max[total]=999999&max[direct]=0"
- FUNCTIONAL_TESTS_DEPENDENCIES="symfony/browser-kit:^5 symfony/css-selector:^5 symfony/framework-bundle:^5 symfony/twig-bundle:^5 symfony/panther:^1"
- COMMON_DEPENDENCIES="symfony/http-client:^5"
- SYMFONY_REQUIRE="5.4.*"

jobs:
fast_finish: true
include:
# Test the latest stable release
- php: 7.4
env: STABILITY="stable" XDEBUG_MODE=coverage COVERAGE=true PHPUNIT_FLAGS="${PHPUNIT_FLAGS_UNIT_TESTS_ONLY} --coverage-text --coverage-clover=build/coverage.xml" DEPENDENCIES="${COMMON_DEPENDENCIES}"
env: STABILITY="stable" XDEBUG_MODE=coverage COVERAGE=true PHPUNIT_FLAGS="${PHPUNIT_FLAGS_UNIT_TESTS_ONLY} --coverage-text --coverage-clover=build/coverage.xml" DEPENDENCIES="${COMMON_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"
- php: 8.0
env: STABILITY="stable" XDEBUG_MODE=coverage COVERAGE=true PHPUNIT_FLAGS="${PHPUNIT_FLAGS_UNIT_TESTS_ONLY} --coverage-text --coverage-clover=build/coverage.xml" DEPENDENCIES="${COMMON_DEPENDENCIES}"
env: STABILITY="stable" XDEBUG_MODE=coverage COVERAGE=true PHPUNIT_FLAGS="${PHPUNIT_FLAGS_UNIT_TESTS_ONLY} --coverage-text --coverage-clover=build/coverage.xml" DEPENDENCIES="${COMMON_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"

- php: 7.4
env: STABILITY="stable" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}"
env: STABILITY="stable" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"
- php: 8.0
env: STABILITY="stable" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}"
env: STABILITY="stable" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"

# Version 6.*
- php: 8.0
env: STABILITY="stable" DEPENDENCIES="symfony/http-client:^6 symfony/browser-kit:^6 symfony/css-selector:^6 symfony/framework-bundle:^6 symfony/twig-bundle:^6 symfony/panther:^2" SYMFONY_REQUIRE="6.*"

allow_failures:
# Latest commit to master
- php: 7.4
env: STABILITY="dev" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}"
env: STABILITY="dev" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"
- php: 8.0
env: STABILITY="dev" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}" SYMFONY_REQUIRE="5.4.*"

# Version 6.*
- php: 8.0
env: STABILITY="dev" DEPENDENCIES="${COMMON_DEPENDENCIES} ${FUNCTIONAL_TESTS_DEPENDENCIES}"
env: STABILITY="dev" DEPENDENCIES="symfony/http-client:^6 symfony/browser-kit:^6 symfony/css-selector:^6 symfony/framework-bundle:^6 symfony/twig-bundle:^6 symfony/panther:^2" SYMFONY_REQUIRE="6.*"

before_install:
- wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz
Expand All @@ -47,7 +54,7 @@ before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- composer global require symfony/flex --prefer-dist --no-interaction
- composer require ${DEPENDENCIES} --prefer-dist --no-interaction
- composer require --with-all-dependencies ${DEPENDENCIES} --prefer-dist --no-interaction

install:
- composer update --prefer-dist --no-interaction
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/SubmitFormWebTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SubmitFormWebTest extends PantherTestCase
public function testEverythingCompilesAndAppRuns()
{
$client = self::bootKernel();
$this->assertNotNull(self::$container);
$this->assertNotNull($client->getContainer());
}

public function testFormIsBuiltAndDisplayed()
Expand Down
4 changes: 3 additions & 1 deletion Tests/Units/BundleInitializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public function setUp(): void
{
$kernel = $this->createKernel();
$kernel->addConfigFile(__DIR__.'/test_config.yml');
if (\Symfony\Component\HttpKernel\Kernel::MAJOR_VERSION > 3) {
if (\Symfony\Component\HttpKernel\Kernel::MAJOR_VERSION > 4) {
$kernel->addConfigFile(__DIR__.'/test_framework_config_sf5.yml');
} else if (\Symfony\Component\HttpKernel\Kernel::MAJOR_VERSION > 3) {
$kernel->addConfigFile(__DIR__.'/test_framework_config_sf4.yml');
}
$this->bootKernel();
Expand Down
8 changes: 8 additions & 0 deletions Tests/Units/test_framework_config_sf5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
framework:
secret: test
test: true
session:
storage_factory_id: session.storage.factory.mock_file
router:
utf8: true

26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"psr/http-message": "^1.0",
"psr/http-client-implementation": "^1.0",
"psr/http-factory-implementation": "^1.0",
"symfony/config": "~5.3",
"symfony/twig-bridge": "~5.3",
"symfony/form": "~5.3",
"symfony/validator": "~5.3"
"symfony/config": "~5.4|~6.0",
"symfony/twig-bridge": "~5.4|~6.0",
"symfony/form": "~5.4|~6.0",
"symfony/validator": "~5.4|~6.0"
},
"require-dev": {
"php-http/mock-client": "^1.4",
"php-http/mock-client": "^1.5",
"nyholm/psr7": "^1.3",
"symfony/phpunit-bridge": "^5.1",
"nyholm/symfony-bundle-test": "^1.6",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"symfony/panther": "^1.1",
"symfony/browser-kit": "^5.3",
"symfony/css-selector": "^5.3",
"symfony/framework-bundle": "^5.3",
"symfony/twig-bundle": "^5.3"
"symfony/phpunit-bridge": "^5.3|^6.0",
"nyholm/symfony-bundle-test": "1.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"symfony/panther": "^1.1|^2.0",
"symfony/browser-kit": "^5.3|^6.0",
"symfony/css-selector": "^5.3|^6.0",
"symfony/framework-bundle": "^5.3|^6.0",
"symfony/twig-bundle": "^5.3|^6.0"
},
"suggest": {
"symfony/http-client": "A Symfony component that implements PSR-18 HTTP client interface"
Expand Down
Loading

0 comments on commit 85de116

Please sign in to comment.