Skip to content

Commit e7f7813

Browse files
committed
Removed hard dependencies on doctrine odm to run the tests
1 parent bb04d57 commit e7f7813

27 files changed

+212
-79
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ reusable-steps:
8787
run:
8888
name: Update Composer
8989
command: sudo composer self-update
90+
- &require-doctrine-odm
91+
run:
92+
name: Require doctrine/mongodb-odm an doctrine/mongodb-odm-bundle
93+
command: composer require --no-update doctrine/mongodb-odm:^2.0.0@beta doctrine/mongodb-odm-bundle:^4.0.0@beta
9094
- &update-project-dependencies
9195
run:
9296
name: Update project dependencies
@@ -134,6 +138,7 @@ jobs:
134138
- *disable-php-memory-limit
135139
- *install-php-extensions
136140
- *update-composer
141+
- *require-doctrine-odm
137142
- *update-project-dependencies
138143
- *save-composer-cache-by-revision
139144
- *save-composer-cache-by-branch

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ cache:
88
jobs:
99
include:
1010
- php: '7.1'
11-
env: NO_UNIT_TESTS=true
12-
before_install:
13-
- composer remove --dev ext-mongodb doctrine/mongodb-odm doctrine/mongodb-odm-bundle
14-
- sed -i '33,39d' tests/Fixtures/app/config/config_common.yml
1511
- php: '7.2'
1612
- php: '7.3'
1713
- php: '7.3'
@@ -46,12 +42,15 @@ before_install:
4642
- if [[ $APP_ENV = 'elasticsearch' ]]; then
4743
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;
4844
fi
49-
- phpenv config-rm xdebug.ini || echo "xdebug not available"
5045
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
51-
- echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
46+
- if [[ $APP_ENV = 'mongodb' ]]; then
47+
echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini;
48+
fi
49+
- phpenv config-rm xdebug.ini || echo "xdebug not available"
5250
- export PATH="$PATH:$HOME/.composer/vendor/bin"
5351

5452
install:
53+
- if [[ $APP_ENV = 'mongodb' ]]; then composer require --no-update doctrine/mongodb-odm:^2.0.0@beta doctrine/mongodb-odm-bundle:^4.0.0@beta; fi
5554
- if [[ $deps = 'low' ]]; then
5655
composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi;
5756
else
@@ -60,11 +59,10 @@ install:
6059

6160
script:
6261
- tests/Fixtures/app/console cache:clear
63-
- if [[ $NO_UNIT_TESTS != true ]]; then
64-
vendor/bin/phpunit;
65-
fi
6662
- if [[ $APP_ENV = 'mongodb' ]]; then
6763
vendor/bin/phpunit -c phpunit.mongo.xml;
64+
else
65+
vendor/bin/phpunit;
6866
fi
6967
- tests/Fixtures/app/console cache:clear
7068
- if [[ $APP_ENV = 'postgres' ]]; then

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
"doctrine/annotations": "^1.2",
3636
"doctrine/doctrine-bundle": "^1.8",
3737
"doctrine/doctrine-cache-bundle": "^1.3.5",
38-
"doctrine/mongodb-odm": "^2.0.0@beta",
39-
"doctrine/mongodb-odm-bundle": "^4.0.0@beta",
4038
"doctrine/orm": "^2.6.3",
4139
"elasticsearch/elasticsearch": "^6.0",
4240
"friendsofsymfony/user-bundle": "^2.2@dev",

phpunit.mongo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors" />
1414
<server name="KERNEL_DIR" value="tests/Fixtures/app/" />
1515
<server name="KERNEL_CLASS" value="AppKernel" />
16-
<server name="APP_ENV" value="test_mongodb" />
16+
<server name="APP_ENV" value="mongodb" />
1717
<server name="LEGACY" value="0" />
1818
</php>
1919

phpunit.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@
3737
<listeners>
3838
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
3939
</listeners>
40+
41+
<groups>
42+
<exclude>
43+
<group>mongodb</group>
44+
</exclude>
45+
</groups>
4046
</phpunit>

tests/Bridge/Doctrine/Common/Util/IdentifierManagerTraitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function testSingleIdentifier()
7070

7171
/**
7272
* @group legacy
73+
* @group mongodb
7374
*/
7475
public function testSingleDocumentIdentifier()
7576
{

tests/Bridge/Doctrine/MongoDbOdm/CollectionDataProviderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* @author Alan Poulain <[email protected]>
31+
* @group mongodb
3132
*/
3233
class CollectionDataProviderTest extends TestCase
3334
{

tests/Bridge/Doctrine/MongoDbOdm/Extension/FilterExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
/**
2727
* @author Alan Poulain <[email protected]>
28+
* @group mongodb
2829
*/
2930
class FilterExtensionTest extends TestCase
3031
{

tests/Bridge/Doctrine/MongoDbOdm/Extension/OrderExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
/**
2828
* @author Alan Poulain <[email protected]>
29+
* @group mongodb
2930
*/
3031
class OrderExtensionTest extends TestCase
3132
{

tests/Bridge/Doctrine/MongoDbOdm/Extension/PaginationExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
/**
3737
* @author Alan Poulain <[email protected]>
38+
* @group mongodb
3839
*/
3940
class PaginationExtensionTest extends TestCase
4041
{

0 commit comments

Comments
 (0)