Merge branch '3.0.x'
This commit is contained in:
commit
034b3a9c60
|
@ -192,6 +192,10 @@ class Configuration implements ConfigurationInterface
|
||||||
->useAttributeAsKey('name')
|
->useAttributeAsKey('name')
|
||||||
->prototype('array')
|
->prototype('array')
|
||||||
->treatNullLike(array())
|
->treatNullLike(array())
|
||||||
|
->beforeNormalization()
|
||||||
|
->ifNull()
|
||||||
|
->thenEmptyArray()
|
||||||
|
->end()
|
||||||
// BC - Renaming 'mappings' node to 'properties'
|
// BC - Renaming 'mappings' node to 'properties'
|
||||||
->beforeNormalization()
|
->beforeNormalization()
|
||||||
->ifTrue(function($v) { return array_key_exists('mappings', $v); })
|
->ifTrue(function($v) { return array_key_exists('mappings', $v); })
|
||||||
|
|
|
@ -199,6 +199,24 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertCount(3, $configuration['indexes']['test']['types']['test']['properties']);
|
$this->assertCount(3, $configuration['indexes']['test']['types']['test']['properties']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testUnconfiguredType()
|
||||||
|
{
|
||||||
|
$configuration = $this->getConfigs(array(
|
||||||
|
'clients' => array(
|
||||||
|
'default' => array('url' => 'http://localhost:9200'),
|
||||||
|
),
|
||||||
|
'indexes' => array(
|
||||||
|
'test' => array(
|
||||||
|
'types' => array(
|
||||||
|
'test' => null
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->assertArrayHasKey('properties', $configuration['indexes']['test']['types']['test']);
|
||||||
|
}
|
||||||
|
|
||||||
public function testNestedProperties()
|
public function testNestedProperties()
|
||||||
{
|
{
|
||||||
$this->getConfigs(array(
|
$this->getConfigs(array(
|
||||||
|
|
Loading…
Reference in a new issue