@@ -44,6 +44,7 @@ public function testLoadClassMetadata()
44
44
'scalar ' ,
45
45
'object ' ,
46
46
'collection ' ,
47
+ 'collectionOfUnknown ' ,
47
48
'alreadyMappedType ' ,
48
49
'alreadyMappedNotNull ' ,
49
50
'alreadyMappedNotBlank ' ,
@@ -61,6 +62,7 @@ public function testLoadClassMetadata()
61
62
[new Type (Type::BUILTIN_TYPE_STRING , true ), new Type (Type::BUILTIN_TYPE_INT ), new Type (Type::BUILTIN_TYPE_BOOL )],
62
63
[new Type (Type::BUILTIN_TYPE_OBJECT , true , Entity::class)],
63
64
[new Type (Type::BUILTIN_TYPE_ARRAY , true , null , true , null , new Type (Type::BUILTIN_TYPE_OBJECT , false , Entity::class))],
65
+ [new Type (Type::BUILTIN_TYPE_ARRAY , true , null , true )],
64
66
[new Type (Type::BUILTIN_TYPE_FLOAT , true )], // The existing constraint is float
65
67
[new Type (Type::BUILTIN_TYPE_STRING , true )],
66
68
[new Type (Type::BUILTIN_TYPE_STRING , true )],
@@ -81,6 +83,7 @@ public function testLoadClassMetadata()
81
83
true ,
82
84
true ,
83
85
true ,
86
+ true ,
84
87
false ,
85
88
true
86
89
))
@@ -135,6 +138,13 @@ public function testLoadClassMetadata()
135
138
$ this ->assertInstanceOf (TypeConstraint::class, $ collectionConstraints [0 ]->constraints [1 ]);
136
139
$ this ->assertSame (Entity::class, $ collectionConstraints [0 ]->constraints [1 ]->type );
137
140
141
+ $ collectionOfUnknownMetadata = $ classMetadata ->getPropertyMetadata ('collectionOfUnknown ' );
142
+ $ this ->assertCount (1 , $ collectionOfUnknownMetadata );
143
+ $ collectionOfUnknownConstraints = $ collectionOfUnknownMetadata [0 ]->getConstraints ();
144
+ $ this ->assertCount (1 , $ collectionOfUnknownConstraints );
145
+ $ this ->assertInstanceOf (TypeConstraint::class, $ collectionOfUnknownConstraints [0 ]);
146
+ $ this ->assertSame ('array ' , $ collectionOfUnknownConstraints [0 ]->type );
147
+
138
148
$ alreadyMappedTypeMetadata = $ classMetadata ->getPropertyMetadata ('alreadyMappedType ' );
139
149
$ this ->assertCount (1 , $ alreadyMappedTypeMetadata );
140
150
$ alreadyMappedTypeConstraints = $ alreadyMappedTypeMetadata [0 ]->getConstraints ();
0 commit comments