mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(tests): Force lazy ghost initialisation in container tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
a42ef7d633
commit
a10182f6fb
1 changed files with 9 additions and 1 deletions
|
|
@ -36,7 +36,9 @@ class ClassComplexConstructor {
|
|||
}
|
||||
|
||||
class ClassNullableUntypedConstructorArg {
|
||||
public $class;
|
||||
public function __construct($class) {
|
||||
$this->class = $class;
|
||||
}
|
||||
}
|
||||
class ClassNullableTypedConstructorArg {
|
||||
|
|
@ -217,6 +219,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 +247,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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue