File tree Expand file tree Collapse file tree 8 files changed +17
-9
lines changed Expand file tree Collapse file tree 8 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,10 @@ jobs:
190190 topology : ${{ matrix.topology }}
191191
192192 - name : " Run PHPUnit"
193- run : " vendor/bin/phpunit --exclude-group=atlas ${{ matrix.dependencies == 'lowest' && '--do-not-fail-on-deprecation --do-not-fail-on-warning --do-not-fail-on-notice' || '' }}"
193+ run : |
194+ vendor/bin/phpunit --exclude-group=atlas \
195+ ${{ matrix.dependencies == 'lowest' && '--do-not-fail-on-deprecation --do-not-fail-on-warning --do-not-fail-on-notice' || '' }} \
196+ ${{ matrix.proxy == 'native' && matrix.dependencies != 'lowest' && '--do-not-fail-on-deprecation' || '' }}
194197 env :
195198 DOCTRINE_MONGODB_SERVER : ${{ steps.setup-mongodb.outputs.cluster-uri }}
196199 USE_LAZY_GHOST_OBJECT : ${{ matrix.proxy == 'lazy-ghost' && '1' || '0' }}
Original file line number Diff line number Diff line change 5252 "phpstan/phpstan" : " ^2.1" ,
5353 "phpstan/phpstan-deprecation-rules" : " ^2.0" ,
5454 "phpstan/phpstan-phpunit" : " ^2.0" ,
55- "phpunit/phpunit" : " ^10.5.58" ,
55+ "phpunit/phpunit" : " ^10.5.58|^11.5.43 " ,
5656 "squizlabs/php_codesniffer" : " ^4" ,
5757 "symfony/cache" : " ^5.4 || ^6.0 || ^7.0 || ^8.0" ,
5858 "symfony/uid" : " ^5.4 || ^6.0 || ^7.0 || ^8.0"
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<phpunit
33 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4- xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10 .5/phpunit.xsd"
4+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/11 .5/phpunit.xsd"
55 bootstrap =" tests/bootstrap.php"
66 cacheDirectory =" .phpunit.cache"
77 displayDetailsOnAllIssues =" true"
Original file line number Diff line number Diff line change @@ -105,12 +105,11 @@ protected static function getConfiguration(): Configuration
105105 $ config ->setPersistentCollectionNamespace ('PersistentCollections ' );
106106 $ config ->setDefaultDB (DOCTRINE_MONGODB_DATABASE );
107107 $ config ->setMetadataDriverImpl (static ::createMetadataDriverImpl ());
108- if ($ _ENV ['USE_LAZY_GHOST_OBJECT ' ]) {
109- $ config ->setUseLazyGhostObject (true );
110- }
111108
112109 if ($ _ENV ['USE_NATIVE_LAZY_OBJECT ' ]) {
113110 $ config ->setUseNativeLazyObject (true );
111+ } elseif ($ _ENV ['USE_LAZY_GHOST_OBJECT ' ]) {
112+ $ config ->setUseLazyGhostObject (true );
114113 }
115114
116115 if ($ config ->isNativeLazyObjectEnabled ()) {
Original file line number Diff line number Diff line change 1111use Doctrine \ODM \MongoDB \PersistentCollection \PersistentCollectionGenerator ;
1212use LogicException ;
1313use MongoDB \Driver \Manager ;
14+ use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1415use PHPUnit \Framework \Attributes \RequiresPhp ;
1516use PHPUnit \Framework \Attributes \TestWith ;
1617use PHPUnit \Framework \TestCase ;
@@ -37,6 +38,7 @@ public function testUseNativeLazyObjectBeforePHP84(): void
3738 $ c ->setUseNativeLazyObject (true );
3839 }
3940
41+ #[IgnoreDeprecations]
4042 public function testUseLazyGhostObject (): void
4143 {
4244 $ c = new Configuration ();
@@ -74,6 +76,7 @@ public function testUseLazyGhostObjectWithSymfony8(): void
7476 $ c ->setUseLazyGhostObject (true );
7577 }
7678
79+ #[IgnoreDeprecations]
7780 public function testNativeLazyObjectDeprecatedByDefault (): void
7881 {
7982 $ c = new Configuration ();
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ public function setUp(): void
3535
3636 public function tearDown (): void
3737 {
38- $ this ->logger ->unregister ();
38+ if (isset ($ this ->logger )) {
39+ $ this ->logger ->unregister ();
40+ }
3941
4042 parent ::tearDown ();
4143 }
Original file line number Diff line number Diff line change 77use Doctrine \ODM \MongoDB \Mapping \Annotations as ODM ;
88use Doctrine \ODM \MongoDB \Mapping \MappingException ;
99use Doctrine \ODM \MongoDB \Tests \BaseTestCase ;
10+ use PHPUnit \Framework \Attributes \DoesNotPerformAssertions ;
1011use stdClass ;
1112
1213class TargetDocumentTest extends BaseTestCase
1314{
14- /** @doesNotPerformAssertions */
15+ #[DoesNotPerformAssertions]
1516 public function testMappedSuperClassAsTargetDocument (): void
1617 {
1718 $ test = new TargetDocumentTestDocument ();
Original file line number Diff line number Diff line change @@ -508,7 +508,7 @@ public function testFindWithHint(): void
508508 $ collection ->expects ($ this ->once ())
509509 ->method ('find ' )
510510 ->with (['foo ' => 'bar ' ], ['hint ' => 'foo ' ])
511- ->will ( $ this -> returnValue ( $ cursor) );
511+ ->willReturn ( $ cursor );
512512
513513 // Using QueryBuilder->find adds hint to the query array
514514 $ queryArray = [
You can’t perform that action at this time.
0 commit comments