Skip to content

Commit 2e0dced

Browse files
committed
Don't try to mock UnitOfWork as it's final
1 parent a5f9f61 commit 2e0dced

File tree

8 files changed

+89
-75
lines changed

8 files changed

+89
-75
lines changed

.circleci/config.yml

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,12 @@ commands:
8383
- run:
8484
name: Disable Xdebug PHP extension
8585
command: sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
86-
install-doctrine-mongodb-odm:
87-
steps:
88-
- run:
89-
name: Install Doctrine MongoDB ODM
90-
command: |
91-
composer require --prefer-dist --no-progress --no-suggest --no-update --ansi \
92-
doctrine/mongodb-odm:^2.0@beta \
93-
doctrine/mongodb-odm-bundle:^4.0@beta \
9486
install-mongodb-php-extension:
9587
steps:
9688
- run:
9789
name: Install mongodb PHP extension
9890
command: |
99-
sudo pecl install mongodb
91+
sudo pecl install mongodb-1.5.4
10092
sudo docker-php-ext-enable mongodb
10193
merge-code-coverage-reports:
10294
parameters:
@@ -274,17 +266,18 @@ jobs:
274266
working_directory: ~/api-platform/core
275267
steps:
276268
- checkout
277-
- restore-composer-cache
278-
- restore-php-cs-fixer-cache
269+
- install-mongodb-php-extension
279270
- disable-xdebug-php-extension
280271
- disable-php-memory-limit
281272
- update-composer
273+
- restore-composer-cache
282274
- run:
283275
name: Install PHP-CS-Fixer
284276
command: |
285277
composer global require --prefer-dist --no-progress --no-suggest --ansi \
286278
friendsofphp/php-cs-fixer:^2.14
287279
- save-composer-cache
280+
- restore-php-cs-fixer-cache
288281
- run:
289282
name: Run PHP-CS-Fixer
290283
command: |
@@ -300,16 +293,15 @@ jobs:
300293
working_directory: ~/api-platform/core
301294
steps:
302295
- checkout
303-
- restore-composer-cache
304-
- restore-phpstan-cache
296+
- install-mongodb-php-extension
305297
- disable-xdebug-php-extension
306298
- disable-php-memory-limit
307-
- install-mongodb-php-extension
308299
- update-composer
309-
- install-doctrine-mongodb-odm
300+
- restore-composer-cache
310301
- update-project-dependencies
311302
- save-composer-cache
312303
- clear-test-app-cache
304+
- restore-phpstan-cache
313305
- run:
314306
name: Run PHPStan
315307
command: vendor/bin/phpstan analyse --ansi
@@ -321,11 +313,11 @@ jobs:
321313
working_directory: ~/api-platform/core
322314
steps:
323315
- checkout
324-
- restore-composer-cache
325-
- restore-npm-cache
316+
- install-mongodb-php-extension
326317
- disable-xdebug-php-extension
327318
- disable-php-memory-limit
328319
- update-composer
320+
- restore-composer-cache
329321
- update-project-dependencies
330322
- save-composer-cache
331323
- clear-test-app-cache
@@ -337,6 +329,7 @@ jobs:
337329
export PARALLEL='-j10% --joblog build/logs/parallel.log --rpl {_}\ s/\\//_/g;'
338330
phpunit_cmd='phpdbg -qrr vendor/bin/phpunit --coverage-php build/coverage/coverage-{_}.cov --log-junit build/logs/phpunit/{_}.xml --exclude-group mongodb,resource-hog --colors=always {}'
339331
echo "$split_tests" | parallel "$phpunit_cmd" || echo "$split_tests" | parallel --retry-failed "$phpunit_cmd"
332+
- restore-npm-cache
340333
- merge-test-reports:
341334
dir: build/logs/phpunit
342335
out: build/logs/phpunit/junit.xml
@@ -367,11 +360,11 @@ jobs:
367360
working_directory: ~/api-platform/core
368361
steps:
369362
- checkout
370-
- restore-composer-cache
371-
- restore-npm-cache
363+
- install-mongodb-php-extension
372364
- disable-xdebug-php-extension
373365
- disable-php-memory-limit
374366
- update-composer
367+
- restore-composer-cache
375368
- update-project-dependencies
376369
- save-composer-cache
377370
- clear-test-app-cache
@@ -383,6 +376,7 @@ jobs:
383376
_f=$(echo "$f" | tr / _)
384377
FEATURE="${_f}" phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/"${_f}" --profile=default-coverage --no-interaction "$f"
385378
done
379+
- restore-npm-cache
386380
- merge-test-reports:
387381
dir: build/logs/behat
388382
out: build/logs/behat/junit.xml
@@ -411,13 +405,11 @@ jobs:
411405
working_directory: ~/api-platform/core
412406
steps:
413407
- checkout
414-
- restore-composer-cache
415-
- restore-npm-cache
408+
- install-mongodb-php-extension
416409
- disable-xdebug-php-extension
417410
- disable-php-memory-limit
418-
- install-mongodb-php-extension
419411
- update-composer
420-
- install-doctrine-mongodb-odm
412+
- restore-composer-cache
421413
- update-project-dependencies
422414
- save-composer-cache
423415
- clear-test-app-cache
@@ -435,6 +427,7 @@ jobs:
435427
- store_artifacts:
436428
path: build/logs/clover.xml
437429
destination: build/logs/clover.xml
430+
- restore-npm-cache
438431
- codecov/upload:
439432
file: build/logs/clover.xml
440433
flags: phpunit_mongodb
@@ -449,13 +442,11 @@ jobs:
449442
working_directory: ~/api-platform/core
450443
steps:
451444
- checkout
452-
- restore-composer-cache
453-
- restore-npm-cache
445+
- install-mongodb-php-extension
454446
- disable-xdebug-php-extension
455447
- disable-php-memory-limit
456-
- install-mongodb-php-extension
457448
- update-composer
458-
- install-doctrine-mongodb-odm
449+
- restore-composer-cache
459450
- update-project-dependencies
460451
- save-composer-cache
461452
- clear-test-app-cache
@@ -465,6 +456,7 @@ jobs:
465456
command: |
466457
mkdir -p build/logs/behat
467458
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=mongodb-coverage --no-interaction
459+
- restore-npm-cache
468460
- merge-test-reports:
469461
dir: build/logs/behat
470462
out: build/logs/behat/junit.xml
@@ -493,11 +485,11 @@ jobs:
493485
working_directory: ~/api-platform/core
494486
steps:
495487
- checkout
496-
- restore-composer-cache
497-
- restore-npm-cache
488+
- install-mongodb-php-extension
498489
- disable-xdebug-php-extension
499490
- disable-php-memory-limit
500491
- update-composer
492+
- restore-composer-cache
501493
- update-project-dependencies
502494
- save-composer-cache
503495
- clear-test-app-cache
@@ -507,6 +499,7 @@ jobs:
507499
command: |
508500
mkdir -p build/logs/behat
509501
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=elasticsearch-coverage --no-interaction
502+
- restore-npm-cache
510503
- merge-test-reports:
511504
dir: build/logs/behat
512505
out: build/logs/behat/junit.xml

.travis.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ cache:
1414
echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
1515
- &disable-xdebug-php-extension |
1616
phpenv config-rm xdebug.ini || echo "xdebug not available"
17-
- &install-doctrine-mongodb-odm |
18-
composer require --prefer-dist --no-progress --no-suggest --no-update --ansi \
19-
doctrine/mongodb-odm:^2.0@beta \
20-
doctrine/mongodb-odm-bundle:^4.0@beta \
2117
- &install-mongodb-php-extension |
2218
echo "extension=mongodb.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/mongodb.ini
2319
- &run-behat-tests |
@@ -39,10 +35,16 @@ jobs:
3935
include:
4036
- php: '7.1'
4137
before_install:
42-
- *disable-php-memory-limit
38+
- *install-mongodb-php-extension
4339
- *disable-xdebug-php-extension
40+
- *disable-php-memory-limit
4441
- *add-composer-bin-dir-to-path
4542
install:
43+
- |
44+
composer remove --dev --no-progress --no-update --ansi \
45+
doctrine/mongodb-odm \
46+
doctrine/mongodb-odm-bundle \
47+
- sed -i '33,39d' tests/Fixtures/app/config/config_common.yml
4648
- *update-project-dependencies
4749
before_script:
4850
- *clear-test-app-cache
@@ -57,8 +59,9 @@ jobs:
5759

5860
- php: '7.2'
5961
before_install:
60-
- *disable-php-memory-limit
62+
- *install-mongodb-php-extension
6163
- *disable-xdebug-php-extension
64+
- *disable-php-memory-limit
6265
- *add-composer-bin-dir-to-path
6366
install:
6467
- *update-project-dependencies
@@ -75,8 +78,9 @@ jobs:
7578

7679
- php: '7.3'
7780
before_install:
78-
- *disable-php-memory-limit
81+
- *install-mongodb-php-extension
7982
- *disable-xdebug-php-extension
83+
- *disable-php-memory-limit
8084
- *add-composer-bin-dir-to-path
8185
install:
8286
- *update-project-dependencies
@@ -94,8 +98,9 @@ jobs:
9498
- php: '7.3'
9599
env: deps=low
96100
before_install:
97-
- *disable-php-memory-limit
101+
- *install-mongodb-php-extension
98102
- *disable-xdebug-php-extension
103+
- *disable-php-memory-limit
99104
- *add-composer-bin-dir-to-path
100105
install:
101106
- composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
@@ -115,8 +120,9 @@ jobs:
115120
services:
116121
- postgresql
117122
before_install:
118-
- *disable-php-memory-limit
123+
- *install-mongodb-php-extension
119124
- *disable-xdebug-php-extension
125+
- *disable-php-memory-limit
120126
- *add-composer-bin-dir-to-path
121127
install:
122128
- *update-project-dependencies
@@ -137,8 +143,9 @@ jobs:
137143
services:
138144
- mysql
139145
before_install:
140-
- *disable-php-memory-limit
146+
- *install-mongodb-php-extension
141147
- *disable-xdebug-php-extension
148+
- *disable-php-memory-limit
142149
- *add-composer-bin-dir-to-path
143150
install:
144151
- *update-project-dependencies
@@ -159,12 +166,11 @@ jobs:
159166
services:
160167
- mongodb
161168
before_install:
162-
- *disable-php-memory-limit
163169
- *install-mongodb-php-extension
164170
- *disable-xdebug-php-extension
171+
- *disable-php-memory-limit
165172
- *add-composer-bin-dir-to-path
166173
install:
167-
- *install-doctrine-mongodb-odm
168174
- *update-project-dependencies
169175
before_script:
170176
- *clear-test-app-cache
@@ -186,8 +192,9 @@ jobs:
186192
- sudo apt-get update
187193
- sudo apt-get install elasticsearch
188194
- sudo service elasticsearch start
189-
- *disable-php-memory-limit
195+
- *install-mongodb-php-extension
190196
- *disable-xdebug-php-extension
197+
- *disable-php-memory-limit
191198
- *add-composer-bin-dir-to-path
192199
install:
193200
- *update-project-dependencies
@@ -205,8 +212,9 @@ jobs:
205212
- php: '7.3'
206213
env: SYMFONY_DEPRECATIONS_HELPER=0
207214
before_install:
208-
- *disable-php-memory-limit
215+
- *install-mongodb-php-extension
209216
- *disable-xdebug-php-extension
217+
- *disable-php-memory-limit
210218
- *add-composer-bin-dir-to-path
211219
install:
212220
- *update-project-dependencies

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
- echo extension=php_mongodb.dll >> php.ini
2727
- echo memory_limit=3G >> php.ini
2828
- cd %APPVEYOR_BUILD_FOLDER%
29-
- composer install --no-interaction --no-progress --no-suggest --ignore-platform-reqs
29+
- composer install --no-progress --no-suggest --no-interaction
3030

3131
services:
3232
- mongodb

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
"behat/symfony2-extension": "^2.1.1",
3434
"behatch/contexts": "3.1.0",
3535
"doctrine/annotations": "^1.2",
36+
"doctrine/data-fixtures": "^1.2.2",
3637
"doctrine/doctrine-bundle": "^1.8",
3738
"doctrine/doctrine-cache-bundle": "^1.3.5",
39+
"doctrine/mongodb-odm": "^2.0@beta",
40+
"doctrine/mongodb-odm-bundle": "^4.0@beta",
3841
"doctrine/orm": "^2.6.3",
3942
"elasticsearch/elasticsearch": "^6.0",
4043
"friendsofsymfony/user-bundle": "^2.2@dev",
@@ -102,10 +105,14 @@
102105
"webonyx/graphql-php": "To support GraphQL."
103106
},
104107
"autoload": {
105-
"psr-4": { "ApiPlatform\\Core\\": "src/" }
108+
"psr-4": {
109+
"ApiPlatform\\Core\\": "src/"
110+
}
106111
},
107112
"autoload-dev": {
108-
"psr-4": { "ApiPlatform\\Core\\Tests\\": "tests/" }
113+
"psr-4": {
114+
"ApiPlatform\\Core\\Tests\\": "tests/"
115+
}
109116
},
110117
"extra": {
111118
"branch-alias": {

0 commit comments

Comments
 (0)