1212use Doctrine \Common \Collections \ExpressionBuilder ;
1313use Doctrine \Deprecations \PHPUnit \VerifyDeprecations ;
1414use PHPUnit \Framework \Attributes \Group ;
15+ use PHPUnit \Framework \Attributes \IgnoreDeprecations ;
1516use PHPUnit \Framework \Attributes \RequiresPhp ;
1617use PHPUnit \Framework \TestCase ;
1718use RuntimeException ;
@@ -80,6 +81,7 @@ public function testGetObjectFieldValueNonexistentFieldAccessingRawValue(): void
8081 $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' , accessRawFieldValues: true );
8182 }
8283
84+ #[IgnoreDeprecations]
8385 public function testGetObjectFieldValueIsAccessor (): void
8486 {
8587 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -89,6 +91,7 @@ public function testGetObjectFieldValueIsAccessor(): void
8991 self ::assertTrue ($ this ->visitor ->getObjectFieldValue ($ object , 'baz ' ));
9092 }
9193
94+ #[IgnoreDeprecations]
9295 public function testGetObjectFieldValueIsAccessorWithIsPrefix (): void
9396 {
9497 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -98,6 +101,7 @@ public function testGetObjectFieldValueIsAccessorWithIsPrefix(): void
98101 self ::assertTrue ($ this ->visitor ->getObjectFieldValue ($ object , 'isBaz ' ));
99102 }
100103
104+ #[IgnoreDeprecations]
101105 public function testGetObjectFieldValueIsAccessorCamelCase (): void
102106 {
103107 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -109,6 +113,7 @@ public function testGetObjectFieldValueIsAccessorCamelCase(): void
109113 self ::assertEquals (1 , $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' ));
110114 }
111115
116+ #[IgnoreDeprecations]
112117 public function testGetObjectFieldValueIsAccessorBoth (): void
113118 {
114119 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -120,6 +125,7 @@ public function testGetObjectFieldValueIsAccessorBoth(): void
120125 self ::assertEquals (2 , $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' ));
121126 }
122127
128+ #[IgnoreDeprecations]
123129 public function testGetObjectFieldValueIsAccessorOnePublic (): void
124130 {
125131 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -131,6 +137,7 @@ public function testGetObjectFieldValueIsAccessorOnePublic(): void
131137 self ::assertEquals (2 , $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' ));
132138 }
133139
140+ #[IgnoreDeprecations]
134141 public function testGetObjectFieldValueIsAccessorBothPublic (): void
135142 {
136143 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -142,6 +149,7 @@ public function testGetObjectFieldValueIsAccessorBothPublic(): void
142149 self ::assertEquals (2 , $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' ));
143150 }
144151
152+ #[IgnoreDeprecations]
145153 public function testGetObjectFieldValueBlankAccessor (): void
146154 {
147155 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -152,6 +160,7 @@ public function testGetObjectFieldValueBlankAccessor(): void
152160 self ::assertEquals (1 , $ this ->visitor ->getObjectFieldValue ($ object , 'fooBar ' ));
153161 }
154162
163+ #[IgnoreDeprecations]
155164 public function testGetObjectFieldValueMagicCallMethod (): void
156165 {
157166 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -161,6 +170,7 @@ public function testGetObjectFieldValueMagicCallMethod(): void
161170 self ::assertEquals (3 , $ this ->visitor ->getObjectFieldValue ($ object , 'qux ' ));
162171 }
163172
173+ #[IgnoreDeprecations]
164174 public function testGetObjectFieldValueArrayAccess (): void
165175 {
166176 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -174,6 +184,7 @@ public function testGetObjectFieldValueArrayAccess(): void
174184 self ::assertSame (33 , $ this ->visitor ->getObjectFieldValue ($ object , 'foo ' ));
175185 }
176186
187+ #[IgnoreDeprecations]
177188 public function testGetObjectFieldValuePublicPropertyIsNull (): void
178189 {
179190 $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/collections/pull/472 ' );
@@ -429,7 +440,7 @@ public function testWalkUnknownCompositeExpressionThrowException(): void
429440 public function testSortByFieldAscending (): void
430441 {
431442 $ objects = [new TestObject ('b ' ), new TestObject ('a ' ), new TestObject ('c ' )];
432- $ sort = ClosureExpressionVisitor::sortByField ('foo ' );
443+ $ sort = ClosureExpressionVisitor::sortByField ('foo ' , accessRawFieldValues: true );
433444
434445 usort ($ objects , $ sort );
435446
@@ -441,7 +452,7 @@ public function testSortByFieldAscending(): void
441452 public function testSortByFieldDescending (): void
442453 {
443454 $ objects = [new TestObject ('b ' ), new TestObject ('a ' ), new TestObject ('c ' )];
444- $ sort = ClosureExpressionVisitor::sortByField ('foo ' , -1 );
455+ $ sort = ClosureExpressionVisitor::sortByField ('foo ' , -1 , accessRawFieldValues: true );
445456
446457 usort ($ objects , $ sort );
447458
@@ -456,7 +467,7 @@ public function testSortByFieldKeepOrderWhenSameValue(): void
456467 $ secondElement = new TestObject ('a ' );
457468
458469 $ objects = [$ firstElement , $ secondElement ];
459- $ sort = ClosureExpressionVisitor::sortByField ('foo ' );
470+ $ sort = ClosureExpressionVisitor::sortByField ('foo ' , accessRawFieldValues: true );
460471
461472 usort ($ objects , $ sort );
462473
@@ -466,8 +477,8 @@ public function testSortByFieldKeepOrderWhenSameValue(): void
466477 public function testSortDelegate (): void
467478 {
468479 $ objects = [new TestObject ('a ' , 'c ' ), new TestObject ('a ' , 'b ' ), new TestObject ('a ' , 'a ' )];
469- $ sort = ClosureExpressionVisitor::sortByField ('bar ' , 1 );
470- $ sort = ClosureExpressionVisitor::sortByField ('foo ' , 1 , $ sort );
480+ $ sort = ClosureExpressionVisitor::sortByField ('bar ' , 1 , accessRawFieldValues: true );
481+ $ sort = ClosureExpressionVisitor::sortByField ('foo ' , 1 , $ sort, accessRawFieldValues: true );
471482
472483 usort ($ objects , $ sort );
473484
0 commit comments