Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
barNode example
$builder
=
new
TreeBuilder
(
'override', 'array',
new
CustomNodeBuilder
(
)
)
;
$definition
=
$builder
->
getRootNode
(
)
->
children
(
)
->
variableNode
(
'variable'
)
;
$this
->
assertInstanceOf
(
VariableNodeDefinition::
class
,
$definition
)
;
}
public
function
testAddANodeType
(
)
{
$builder
=
new
TreeBuilder
(
'override', 'array',
new
CustomNodeBuilder
(
)
)
;
$definition
=
$builder
->
getRootNode
(
)
->
children
(
)
->
barNode
(
'variable'
)
;
$this
->
assertInstanceOf
(
BarNodeDefinition::
class
,
$definition
)
;
}
public
function
testCreateABuiltInNodeTypeWithACustomNodeBuilder
(
)
{
$builder
=
new
TreeBuilder
(
'builtin', 'array',
new
CustomNodeBuilder
(
)
)
;
$definition
=
$builder
->
getRootNode
(
)
->
children
(
)
->
booleanNode
(
'boolean'
)
;
$this
->
assertInstanceOf
(
BooleanNodeDefinition::
class
,
$definition
)
;
}