diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-05-05 10:17:19 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2025-05-05 14:29:03 +0200 |
commit | ab38e14c751e3e0ca88f7e42eae5392ed22b415f (patch) | |
tree | daed4e11dcc966f0c2b1f1924b24a66f2d2f6436 /tests | |
parent | 0dc1233c19346ceebeb5ae3f0b7f30f0880d2265 (diff) | |
download | nextcloud-server-feat/use-php84-lazy-objects.tar.gz nextcloud-server-feat/use-php84-lazy-objects.zip |
fix(tests): Force lazy ghost initialisation in container testsfeat/use-php84-lazy-objects
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Utility/SimpleContainerTest.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/AppFramework/Utility/SimpleContainerTest.php b/tests/lib/AppFramework/Utility/SimpleContainerTest.php index d3e9dec18e0..2d9e4f8ea4c 100644 --- a/tests/lib/AppFramework/Utility/SimpleContainerTest.php +++ b/tests/lib/AppFramework/Utility/SimpleContainerTest.php @@ -217,6 +217,8 @@ class SimpleContainerTest extends \Test\TestCase { $object = $this->container->query( 'Test\AppFramework\Utility\ClassComplexConstructor' ); + /* Use the object to trigger DI on PHP >= 8.4 */ + get_object_vars($object); } public function testRegisterFactory(): void { @@ -243,7 +245,11 @@ class SimpleContainerTest extends \Test\TestCase { public function testQueryUntypedNullable(): void { $this->expectException(\OCP\AppFramework\QueryException::class); - $this->container->query(ClassNullableUntypedConstructorArg::class); + $object = $this->container->query( + ClassNullableUntypedConstructorArg::class + ); + /* Use the object to trigger DI on PHP >= 8.4 */ + get_object_vars($object); } public function testQueryTypedNullable(): void { |