aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-05-05 10:17:19 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2025-05-05 14:29:03 +0200
commitab38e14c751e3e0ca88f7e42eae5392ed22b415f (patch)
treedaed4e11dcc966f0c2b1f1924b24a66f2d2f6436 /tests
parent0dc1233c19346ceebeb5ae3f0b7f30f0880d2265 (diff)
downloadnextcloud-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.php8
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 {