Test mappings key being null still causes appropriate configuration changes
This commit is contained in:
parent
f6e018f011
commit
c44f676224
|
@ -182,7 +182,7 @@ class Configuration implements ConfigurationInterface
|
|||
->treatNullLike(array())
|
||||
// BC - Renaming 'mappings' node to 'properties'
|
||||
->beforeNormalization()
|
||||
->ifTrue(function($v) { return isset($v['mappings']); })
|
||||
->ifTrue(function($v) { return array_key_exists('mappings', $v); })
|
||||
->then(function($v) {
|
||||
$v['properties'] = $v['mappings'];
|
||||
unset($v['mappings']);
|
||||
|
@ -213,7 +213,7 @@ class Configuration implements ConfigurationInterface
|
|||
foreach ($v['dynamic_templates'] as $key => $type) {
|
||||
if (is_int($key)) {
|
||||
$dt[] = $type;
|
||||
} else {
|
||||
} else {
|
||||
$dt[][$key] = $type;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class ConfigurationManagerTest extends WebTestCase
|
|||
$index = $manager->getIndexConfiguration('index');
|
||||
|
||||
$this->assertEquals('index', $index->getName());
|
||||
$this->assertCount(2, $index->getTypes());
|
||||
$this->assertGreaterThanOrEqual(2, count($index->getTypes()));
|
||||
$this->assertInstanceOf('FOS\\ElasticaBundle\\Configuration\\TypeConfig', $index->getType('type'));
|
||||
$this->assertInstanceOf('FOS\\ElasticaBundle\\Configuration\\TypeConfig', $index->getType('parent'));
|
||||
}
|
||||
|
|
|
@ -83,3 +83,5 @@ fos_elastica:
|
|||
type: "parent"
|
||||
property: "parent"
|
||||
identifier: "id"
|
||||
null_mappings:
|
||||
mappings: ~
|
||||
|
|
Loading…
Reference in a new issue