File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Tests/DependencyInjection Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,10 @@ protected function getTypesNode()
192192 ->useAttributeAsKey ('name ' )
193193 ->prototype ('array ' )
194194 ->treatNullLike (array ())
195+ ->beforeNormalization ()
196+ ->ifNull ()
197+ ->thenEmptyArray ()
198+ ->end ()
195199 // BC - Renaming 'mappings' node to 'properties'
196200 ->beforeNormalization ()
197201 ->ifTrue (function ($ v ) { return array_key_exists ('mappings ' , $ v ); })
Original file line number Diff line number Diff line change @@ -199,6 +199,24 @@ public function testMappingsRenamedToProperties()
199199 $ this ->assertCount (3 , $ configuration ['indexes ' ]['test ' ]['types ' ]['test ' ]['properties ' ]);
200200 }
201201
202+ public function testUnconfiguredType ()
203+ {
204+ $ configuration = $ this ->getConfigs (array (
205+ 'clients ' => array (
206+ 'default ' => array ('url ' => 'http://localhost:9200 ' ),
207+ ),
208+ 'indexes ' => array (
209+ 'test ' => array (
210+ 'types ' => array (
211+ 'test ' => null
212+ )
213+ )
214+ )
215+ ));
216+
217+ $ this ->assertArrayHasKey ('properties ' , $ configuration ['indexes ' ]['test ' ]['types ' ]['test ' ]);
218+ }
219+
202220 public function testNestedProperties ()
203221 {
204222 $ this ->getConfigs (array (
You can’t perform that action at this time.
0 commit comments