public function ElementTest::providerVisibleChildren in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Render/ElementTest.php \Drupal\Tests\Core\Render\ElementTest::providerVisibleChildren()
Data provider for testVisibleChildren.
Return value
array
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ ElementTest.php, line 144
Class
- ElementTest
- @coversDefaultClass \Drupal\Core\Render\Element @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function providerVisibleChildren() {
return [
[
[
'#property1' => '',
'#property2' => [],
],
[],
],
[
[
'#property1' => '',
'child1' => [],
],
[
'child1',
],
],
[
[
'#property1' => '',
'child1' => [],
'child2' => [
'#access' => TRUE,
],
],
[
'child1',
'child2',
],
],
[
[
'#property1' => '',
'child1' => [],
'child2' => [
'#access' => FALSE,
],
],
[
'child1',
],
],
'access_result_object_allowed' => [
[
'#property1' => '',
'child1' => [],
'child2' => [
'#access' => AccessResult::allowed(),
],
],
[
'child1',
'child2',
],
],
'access_result_object_forbidden' => [
[
'#property1' => '',
'child1' => [],
'child2' => [
'#access' => AccessResult::forbidden(),
],
],
[
'child1',
],
],
[
[
'#property1' => '',
'child1' => [],
'child2' => [
'#type' => 'textfield',
],
],
[
'child1',
'child2',
],
],
[
[
'#property1' => '',
'child1' => [],
'child2' => [
'#type' => 'value',
],
],
[
'child1',
],
],
[
[
'#property1' => '',
'child1' => [],
'child2' => [
'#type' => 'hidden',
],
],
[
'child1',
],
],
];
}