From 62163fa108d695a81618c4fa86ac97f72a813629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 1 Feb 2019 17:07:37 +0100 Subject: [PATCH 1/2] CI: install MongoDB stuff only when needed, upgrade to PHPUnit 8 --- .travis.yml | 7 +++++-- composer.json | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33df8456376..24a9bf33b8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,12 +46,15 @@ before_install: - if [[ $APP_ENV = 'elasticsearch' ]]; then curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.0.deb && sudo dpkg -i --force-confnew elasticsearch-6.5.0.deb && sudo service elasticsearch restart; fi - - phpenv config-rm xdebug.ini || echo "xdebug not available" - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - if [[ $APP_ENV = 'mongodb' ]]; then + echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; + fi + - phpenv config-rm xdebug.ini || echo "xdebug not available" - export PATH="$PATH:$HOME/.composer/vendor/bin" install: + - if [[ $APP_ENV = 'mongodb' ]]; then composer require "doctrine/mongodb-odm:^2.0.0@beta doctrine/mongodb-odm-bundle:^4.0.0@beta"; fi - if [[ $deps = 'low' ]]; then composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi; else diff --git a/composer.json b/composer.json index 011e73f0c74..505f73f181d 100644 --- a/composer.json +++ b/composer.json @@ -35,8 +35,6 @@ "doctrine/annotations": "^1.2", "doctrine/doctrine-bundle": "^1.8", "doctrine/doctrine-cache-bundle": "^1.3.5", - "doctrine/mongodb-odm": "^2.0.0@beta", - "doctrine/mongodb-odm-bundle": "^4.0.0@beta", "doctrine/orm": "^2.6.3", "elasticsearch/elasticsearch": "^6.0", "friendsofsymfony/user-bundle": "dev-fix-mongodb-mapping", @@ -47,7 +45,7 @@ "phpdocumentor/reflection-docblock": "^3.0 || ^4.0", "phpdocumentor/type-resolver": "^0.3 || ^0.4", "phpspec/prophecy": "^1.8", - "phpunit/phpunit": "^7.5.2", + "phpunit/phpunit": "^7.5.2 || ^8.0", "psr/log": "^1.0", "ramsey/uuid": "^3.7", "ramsey/uuid-doctrine": "^1.4", From 08e57da39686602396ee00236fed4f561397ed2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 12 Feb 2019 18:26:44 +0100 Subject: [PATCH 2/2] Move the config to the appropriate place --- tests/Fixtures/app/config/config_common.yml | 7 ------- tests/Fixtures/app/config/config_mongodb.yml | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/Fixtures/app/config/config_common.yml b/tests/Fixtures/app/config/config_common.yml index 836d8cbb48d..080af32b1ed 100644 --- a/tests/Fixtures/app/config/config_common.yml +++ b/tests/Fixtures/app/config/config_common.yml @@ -30,13 +30,6 @@ doctrine: auto_generate_proxy_classes: '%kernel.debug%' auto_mapping: true -doctrine_mongodb: - connections: - default: ~ - document_managers: - default: - auto_mapping: true - twig: strict_variables: '%kernel.debug%' diff --git a/tests/Fixtures/app/config/config_mongodb.yml b/tests/Fixtures/app/config/config_mongodb.yml index b98821a1d5c..7faf9f7b19d 100644 --- a/tests/Fixtures/app/config/config_mongodb.yml +++ b/tests/Fixtures/app/config/config_mongodb.yml @@ -8,3 +8,6 @@ doctrine_mongodb: server: '%server%' options: {} default_database: '%dbname%' + document_managers: + default: + auto_mapping: true