mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
final test for configuration refs #265
This commit is contained in:
parent
e987a891a7
commit
9ec7889595
@ -29,7 +29,14 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|||||||
*/
|
*/
|
||||||
class ConfigCustomizablesEntitiesTest extends KernelTestCase
|
class ConfigCustomizablesEntitiesTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
public function testEmptyConfig()
|
/**
|
||||||
|
* Test that the config does work if the option
|
||||||
|
* chill_custom_fields.customizables_entities IS NOT present
|
||||||
|
*
|
||||||
|
* In this case, parameter 'chill_custom_fields.customizables_entities'
|
||||||
|
* should be an empty array in container
|
||||||
|
*/
|
||||||
|
public function testNotPresentInConfig()
|
||||||
{
|
{
|
||||||
self::bootKernel(array('environment' => 'test'));
|
self::bootKernel(array('environment' => 'test'));
|
||||||
$customizableEntities = static::$kernel->getContainer()
|
$customizableEntities = static::$kernel->getContainer()
|
||||||
@ -38,4 +45,26 @@ class ConfigCustomizablesEntitiesTest extends KernelTestCase
|
|||||||
$this->assertInternalType('array', $customizableEntities);
|
$this->assertInternalType('array', $customizableEntities);
|
||||||
$this->assertCount(0, $customizableEntities);
|
$this->assertCount(0, $customizableEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that the 'chill_custom_fields.customizables_entities' is filled
|
||||||
|
* correctly with a minimal configuration.
|
||||||
|
*
|
||||||
|
* @internal use a custom config environment
|
||||||
|
*/
|
||||||
|
public function testNotEmptyConfig()
|
||||||
|
{
|
||||||
|
self::bootKernel(array('environment' => 'test_customizable_entities_test_not_empty_config'));
|
||||||
|
$customizableEntities = static::$kernel->getContainer()
|
||||||
|
->getParameter('chill_custom_fields.customizables_entities');
|
||||||
|
|
||||||
|
$this->assertInternalType('array', $customizableEntities);
|
||||||
|
$this->assertCount(1, $customizableEntities);
|
||||||
|
|
||||||
|
foreach($customizableEntities as $key => $config) {
|
||||||
|
$this->assertInternalType('array', $config);
|
||||||
|
$this->assertArrayHasKey('name', $config);
|
||||||
|
$this->assertArrayHasKey('class', $config);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
#required by ConfigCustomizablesEntitiesTest::testNotEmptyConfig
|
||||||
|
|
||||||
|
imports:
|
||||||
|
- { resource: config_test.yml }
|
||||||
|
|
||||||
|
chill_custom_fields:
|
||||||
|
customizables_entities:
|
||||||
|
- { class: Test\With\A\Dummy\Entity, name: test }
|
Loading…
x
Reference in New Issue
Block a user