|
8 | 8 | use Tests\Orisai\ObjectMapper\Doubles\FieldNames\FieldNameIdenticalWithAnotherPropertyNameVO; |
9 | 9 | use Tests\Orisai\ObjectMapper\Doubles\FieldNames\MultipleIdenticalFieldNamesVO; |
10 | 10 | use Tests\Orisai\ObjectMapper\Toolkit\ProcessingTestCase; |
| 11 | +use const PHP_VERSION_ID; |
11 | 12 |
|
12 | 13 | final class MetaLoaderTest extends ProcessingTestCase |
13 | 14 | { |
@@ -69,4 +70,42 @@ public function testMultipleIdenticalPropertyNames(): void |
69 | 70 | $this->metaLoader->load(ChildCollidingFieldVO::class); |
70 | 71 | } |
71 | 72 |
|
| 73 | + /** |
| 74 | + * @runInSeparateProcess |
| 75 | + */ |
| 76 | + public function testPreload(): void |
| 77 | + { |
| 78 | + $excludes = []; |
| 79 | + $excludes[] = __DIR__ . '/../../Doubles/FieldNames/FieldNameIdenticalWithAnotherPropertyNameVO.php'; |
| 80 | + $excludes[] = __DIR__ . '/../../Doubles/FieldNames/MultipleIdenticalFieldNamesVO.php'; |
| 81 | + $excludes[] = __DIR__ . '/../../Doubles/FieldNames/ChildCollidingFieldVO.php'; |
| 82 | + $excludes[] = __DIR__ . '/../../Doubles/Constructing/DependentVO.php'; |
| 83 | + |
| 84 | + if (PHP_VERSION_ID < 8_00_00) { |
| 85 | + $excludes[] = __DIR__ . '/../../Doubles/PhpVersionSpecific/AttributesVO.php'; |
| 86 | + } |
| 87 | + |
| 88 | + if (PHP_VERSION_ID < 8_01_00) { |
| 89 | + $excludes[] = __DIR__ . '/../../Doubles/Callbacks/ObjectInitializingVoPhp81.php'; |
| 90 | + $excludes[] = __DIR__ . '/../../Doubles/Enums'; |
| 91 | + $excludes[] = __DIR__ . '/../../Doubles/PhpVersionSpecific/ConstructorPromotedVO.php'; |
| 92 | + $excludes[] = __DIR__ . '/../../Doubles/PhpVersionSpecific/ObjectDefaultVO.php'; |
| 93 | + $excludes[] = __DIR__ . '/../../Doubles/PhpVersionSpecific/ReadonlyPropertiesVO.php'; |
| 94 | + } |
| 95 | + |
| 96 | + if (PHP_VERSION_ID < 8_02_00) { |
| 97 | + $excludes[] = __DIR__ . '/../../Doubles/PhpVersionSpecific/ReadonlyClassVO.php'; |
| 98 | + } |
| 99 | + |
| 100 | + $this->metaLoader->preloadFromPaths( |
| 101 | + [ |
| 102 | + __DIR__ . '/../../Doubles', |
| 103 | + ], |
| 104 | + $excludes, |
| 105 | + ); |
| 106 | + |
| 107 | + // Makes PHPUnit happy |
| 108 | + self::assertTrue(true); |
| 109 | + } |
| 110 | + |
72 | 111 | } |
0 commit comments