'enabled' => true, 'foo' => 'bar'
],
[['enabled' => true
]], 'An enableable node can be enabled'
],
[['enabled' => true, 'foo' => 'baz'
],
[['foo' => 'baz'
]], 'any configuration enables an enableable node'
],
[['enabled' => false, 'foo' => 'baz'
],
[['foo' => 'baz', 'enabled' => false
]], 'An enableable node can be disabled'
],
[['enabled' => false, 'foo' => 'bar'
],
[false
], 'false disables an enableable node'
],
];
} public function testRequiresAtLeastOneElement() { $node =
new ArrayNodeDefinition('root'
);
$node ->
requiresAtLeastOneElement() ->
integerPrototype();
$node->
getNode()->
finalize([1
]);
$this->
addToAssertionCount(1
);
} public function testCannotBeEmpty() { $this->
expectException(InvalidConfigurationException::
class);
$this->
expectExceptionMessage('The path "root" should have at least 1 element(s) defined.'
);