'#property1' => '', 'child1' =>
[], 'child2' =>
['#type' => 'value'
]],
['child1'
]],
[['#property1' => '', 'child1' =>
[], 'child2' =>
['#type' => 'hidden'
]],
['child1'
]],
];
} /**
* Tests the setAttributes() method.
*
* @dataProvider providerTestSetAttributes
*/
public function testSetAttributes($element,
$map,
$expected_element) { Element::
setAttributes($element,
$map);
$this->
assertSame($expected_element,
$element);
} /**
* Data provider for testSetAttributes().
*/
public function providerTestSetAttributes() { $base =
['#id' => 'id', '#class' =>
[]];
return [ [$base,
[],
$base],
[$base,
['id', 'class'
],
$base +
['#attributes' =>
['id' => 'id', 'class' =>
[]]]],
[