Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

allow symfony5 #322

Closed
wants to merge 10 commits into from
Closed

allow symfony5 #322

wants to merge 10 commits into from

Conversation

zghosts
Copy link

@zghosts zghosts commented Nov 23, 2019

Allows for installing on symfony 5 #SymfonyHackday

@garak
Copy link
Contributor

garak commented Dec 2, 2019

This is not enough. We need to update travis config (and, of course, make tests passing).
Here is a working patch:

diff --git a/.travis.yml b/.travis.yml
index ce6a4ad..29dd8ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,7 @@ php:
     - 7.1
     - 7.2
     - 7.3
+    - 7.4snapshot
 
 env:
     global:
@@ -18,9 +19,11 @@ env:
 matrix:
     include:
         - php: 5.6
-          env: MONGO_EXTENSION="mongo.so" SYMFONY_VERSION="symfony/lts:^2"
-        - php: 7.1
-          env: SYMFONY_VERSION="symfony/lts:^3"
+          env: MONGO_EXTENSION="mongo.so" SYMFONY_VERSION="^2.8"
+        - php: 7.2
+          env: MONGO_EXTENSION="mongo.so" SYMFONY_VERSION="^3.4"
+        - php: 7.3
+          env: SYMFONY_VERSION="^4.4"
     fast_finish: true
 
 services:
@@ -33,7 +36,10 @@ before_install:
 
 before_script:
     - composer config platform.ext-mongo 1.6.16
-    - if [ "$SYMFONY_VERSION" != "" ]; then travis_wait composer require --no-update $SYMFONY_VERSION; fi;
+    - |
+      if [ "$SYMFONY_VERSION" != "" ]; then
+           sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'$SYMFONY_VERSION'"/' composer.json;
+      fi;
     - travis_wait composer update --prefer-dist --no-interaction $COMPOSER_FLAGS
     - if ! [[ $TRAVIS_PHP_VERSION =~ ^5 ]]; then composer require alcaeus/mongo-php-adapter; fi;
 
diff --git a/Tests/TestCase.php b/Tests/TestCase.php
index 6482bf9..dd5eafc 100644
--- a/Tests/TestCase.php
+++ b/Tests/TestCase.php
@@ -140,6 +140,13 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
 
         $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/../vendor/symfony/framework-bundle/Resources/config'));
         $loadXml->load('services.xml');
+        $loadXml->load('web.xml');
+        $loadXml->load('error_renderer.xml');
+        #$loadXml->load('serializer.xml');
+        $loadXml->load('cache.xml');
+
+        $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/../vendor/doctrine/doctrine-bundle/Resources/config'));
+        $loadXml->load('dbal.xml');
 
         $loadXml = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loadXml->load('services.xml');
diff --git a/composer.json b/composer.json
index 38868a7..fcbcf0c 100644
--- a/composer.json
+++ b/composer.json
@@ -24,6 +24,7 @@
         "symfony/form": "~2.8|~3.0|^4.0"
     },
     "require-dev": {
+        "doctrine/doctrine-bundle": "^1.12|^2.0",
         "doctrine/mongodb-odm-bundle": "^3.0",
         "phpunit/phpunit": "~5.0|^7.5"
     },

@garak
Copy link
Contributor

garak commented Dec 2, 2019

Can't use 7.4 in travis (not yet, at least), need to use 7.4snapshot instead.
Also, we need to lower constraints for doctrine/doctrine-bundle to 1.10 for older PHP versions

@garak
Copy link
Contributor

garak commented Dec 2, 2019

Need to require "doctrine/mongodb-odm-bundle": "^3.0|^4.0" (sorry I couldn't test with mongo since I lack extension)

@gilles-g
Copy link
Member

gilles-g commented Dec 2, 2019

Hi @garak,

Thx I will try your patch, but why php7.4? why not? :D

I think the TestCase could be refactored 🤔

@gilles-g gilles-g mentioned this pull request Dec 12, 2019
4 tasks
@gilles-g gilles-g closed this Dec 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants