|
4 | 4 |
|
5 | 5 | namespace Doctrine\Tests\ORM; |
6 | 6 |
|
| 7 | +use Doctrine\Deprecations\PHPUnit\VerifyDeprecations; |
7 | 8 | use Doctrine\ORM\Cache\CacheConfiguration; |
8 | 9 | use Doctrine\ORM\Configuration; |
9 | 10 | use Doctrine\ORM\EntityRepository; |
|
17 | 18 | use Doctrine\Persistence\Mapping\Driver\MappingDriver; |
18 | 19 | use Doctrine\Tests\Models\DDC753\DDC753CustomRepository; |
19 | 20 | use PHPUnit\Framework\Attributes\Group; |
| 21 | +use PHPUnit\Framework\Attributes\RequiresPhp; |
| 22 | +use PHPUnit\Framework\Attributes\WithoutErrorHandler; |
20 | 23 | use PHPUnit\Framework\TestCase; |
21 | 24 | use Psr\Cache\CacheItemPoolInterface; |
22 | 25 |
|
|
25 | 28 | */ |
26 | 29 | class ConfigurationTest extends TestCase |
27 | 30 | { |
| 31 | + use VerifyDeprecations; |
| 32 | + |
28 | 33 | private Configuration $configuration; |
29 | 34 |
|
30 | 35 | protected function setUp(): void |
@@ -212,4 +217,28 @@ public function testSetGetTypedFieldMapper(): void |
212 | 217 | $this->configuration->setTypedFieldMapper($defaultTypedFieldMapper); |
213 | 218 | self::assertSame($defaultTypedFieldMapper, $this->configuration->getTypedFieldMapper()); |
214 | 219 | } |
| 220 | + |
| 221 | + #[RequiresPhp('8.4')] |
| 222 | + #[WithoutErrorHandler] |
| 223 | + public function testDisablingNativeLazyObjectsIsDeprecated(): void |
| 224 | + { |
| 225 | + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/12005'); |
| 226 | + |
| 227 | + $this->configuration->enableNativeLazyObjects(false); |
| 228 | + } |
| 229 | + |
| 230 | + #[RequiresPhp('<8.4')] |
| 231 | + public function testNotEnablingNativeLazyObjectIsFineOnPhpLowerThan84(): void |
| 232 | + { |
| 233 | + $this->expectNoDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/12005'); |
| 234 | + self::assertFalse($this->configuration->isNativeLazyObjectsEnabled()); |
| 235 | + } |
| 236 | + |
| 237 | + #[RequiresPhp('8.4')] |
| 238 | + #[WithoutErrorHandler] |
| 239 | + public function testNotEnablingNativeLazyObjectIsDeprecatedOnPhp84(): void |
| 240 | + { |
| 241 | + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/12005'); |
| 242 | + self::assertFalse($this->configuration->isNativeLazyObjectsEnabled()); |
| 243 | + } |
215 | 244 | } |
0 commit comments