function NestedArrayTest::providerTestFilter
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php \Drupal\Tests\Component\Utility\NestedArrayTest::providerTestFilter()
- 8.9.x core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php \Drupal\Tests\Component\Utility\NestedArrayTest::providerTestFilter()
- 11.x core/tests/Drupal/Tests/Component/Utility/NestedArrayTest.php \Drupal\Tests\Component\Utility\NestedArrayTest::providerTestFilter()
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ NestedArrayTest.php, line 271
Class
- NestedArrayTest
- @coversDefaultClass \Drupal\Component\Utility\NestedArray @group Utility
Namespace
Drupal\Tests\Component\UtilityCode
public static function providerTestFilter() {
$data = [];
$data['1d-array'] = [
[
0,
1,
'',
TRUE,
],
NULL,
[
1 => 1,
3 => TRUE,
],
];
$data['1d-array-callable'] = [
[
0,
1,
'',
TRUE,
],
function ($element) {
return $element === '';
},
[
2 => '',
],
];
$data['2d-array'] = [
[
[
0,
1,
'',
TRUE,
],
[
0,
1,
2,
3,
],
],
NULL,
[
0 => [
1 => 1,
3 => TRUE,
],
1 => [
1 => 1,
2 => 2,
3 => 3,
],
],
];
$data['2d-array-callable'] = [
[
[
0,
1,
'',
TRUE,
],
[
0,
1,
2,
3,
],
],
function ($element) {
return is_array($element) || $element === 3;
},
[
0 => [],
1 => [
3 => 3,
],
],
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.