function FrontMatterTest::providerFrontMatterData
Same name in other branches
- 10 core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php \Drupal\Tests\Component\FrontMatter\FrontMatterTest::providerFrontMatterData()
- 11.x core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php \Drupal\Tests\Component\FrontMatter\FrontMatterTest::providerFrontMatterData()
Provides the front matter data to test.
Return value
array Array of front matter data.
File
-
core/
tests/ Drupal/ Tests/ Component/ FrontMatter/ FrontMatterTest.php, line 105
Class
- FrontMatterTest
- Tests front matter parsing helper methods.
Namespace
Drupal\Tests\Component\FrontMatterCode
public static function providerFrontMatterData() {
$data['none'] = [
'yaml' => NULL,
'line' => 1,
];
$data['scalar'] = [
'yaml' => [
'string' => 'value',
'number' => 42,
'bool' => TRUE,
'null' => NULL,
],
'line' => 7,
];
$data['indexed_arrays'] = [
'yaml' => [
'brackets' => [
1,
2,
3,
],
'items' => [
'item1',
'item2',
'item3',
],
],
'line' => 11,
];
$data['associative_arrays'] = [
'yaml' => [
'brackets' => [
'a' => 1,
'b' => 2,
'c' => 3,
],
'items' => [
'a' => 'item1',
'b' => 'item2',
'c' => 'item3',
],
],
'line' => 11,
];
$data['empty_data'] = [
'yaml' => [],
'line' => 3,
];
$data['empty_content'] = [
'yaml' => [
'key' => 'value',
],
'line' => 4,
'content' => '',
];
$data['empty_data_and_content'] = [
'yaml' => [],
'line' => 3,
'content' => '',
];
$data['empty_string'] = [
'yaml' => NULL,
'line' => 1,
'content' => '',
];
$data['multiple_separators'] = [
'yaml' => [
'key' => '---',
],
'line' => 4,
'content' => "Something\n---\nSomething more",
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.