Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
canBeDisabled example
$this
->
assertEquals
(
$expected
,
$processor
->
process
(
$node
->
getNode
(
)
,
$config
)
,
$message
)
;
}
public
function
testCanBeDisabled
(
)
{
$node
=
new
ArrayNodeDefinition
(
'root'
)
;
$node
->
canBeDisabled
(
)
;
$this
->
assertTrue
(
$this
->
getField
(
$node
, 'addDefaults'
)
)
;
$this
->
assertEquals
(
[
'enabled' => false
]
,
$this
->
getField
(
$node
, 'falseEquivalent'
)
)
;
$this
->
assertEquals
(
[
'enabled' => true
]
,
$this
->
getField
(
$node
, 'trueEquivalent'
)
)
;
$this
->
assertEquals
(
[
'enabled' => true
]
,
$this
->
getField
(
$node
, 'nullEquivalent'
)
)
;
$nodeChildren
=
$this
->
getField
(
$node
, 'children'
)
;
$this
->
assertArrayHasKey
(
'enabled',
$nodeChildren
)
;
$enabledNode
=
$nodeChildren
[
'enabled'
]
;
$this
->
assertTrue
(
$this
->
getField
(
$enabledNode
, 'default'
)
)
;
$this
->
addWebhookSection
(
$rootNode
,
$enableIfStandalone
)
;
$this
->
addRemoteEventSection
(
$rootNode
,
$enableIfStandalone
)
;
return
$treeBuilder
;
}
private
function
addSecretsSection
(
ArrayNodeDefinition
$rootNode
)
: void
{
$rootNode
->
children
(
)
->
arrayNode
(
'secrets'
)
->
canBeDisabled
(
)
->
children
(
)
->
scalarNode
(
'vault_directory'
)
->
defaultValue
(
'%kernel.project_dir%/config/secrets/%kernel.runtime_environment%'
)
->
cannotBeEmpty
(
)
->
end
(
)
->
scalarNode
(
'local_dotenv_file'
)
->
defaultValue
(
'%kernel.project_dir%/.env.%kernel.environment%.local'
)
->
end
(
)
->
scalarNode
(
'decryption_env_var'
)
->
defaultValue
(
'base64:default::SYMFONY_DECRYPTION_SECRET'
)
->
end
(
)
->
end
(
)
->
end
(
)
->
end
(
)
;
}
private
function
addCsrfSection
(
ArrayNodeDefinition
$rootNode
)
: void
{