Don't default url
This commit is contained in:
parent
5a84d55129
commit
f97e66712a
|
@ -96,7 +96,7 @@ class Configuration implements ConfigurationInterface
|
|||
->children()
|
||||
->scalarNode('url')
|
||||
->validate()
|
||||
->ifTrue(function($url) { return substr($url, -1) !== '/'; })
|
||||
->ifTrue(function($url) { return $url && substr($url, -1) !== '/'; })
|
||||
->then(function($url) { return $url.'/'; })
|
||||
->end()
|
||||
->end()
|
||||
|
|
|
@ -219,4 +219,18 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertArrayHasKey('properties', $mapping['children']['properties']['tags']);
|
||||
$this->assertArrayNotHasKey('properties', $mapping['children']['properties']['tags']['properties']['tag']);
|
||||
}
|
||||
|
||||
public function testClientConfigurationNoUrl()
|
||||
{
|
||||
$configuration = $this->getConfigs(array(
|
||||
'clients' => array(
|
||||
'default' => array(
|
||||
'host' => 'localhost',
|
||||
'port' => 9200,
|
||||
),
|
||||
)
|
||||
));
|
||||
|
||||
$this->assertTrue(empty($configuration['clients']['default']['servers'][0]['url']));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue