public function WebformYamlTest::providerDecode in Webform 8.5
Same name and namespace in other branches
- 6.x tests/src/Unit/Utility/WebformYamlTest.php \Drupal\Tests\webform\Unit\Utility\WebformYamlTest::providerDecode()
Data provider for testDecode().
See also
testDecode()
File
- tests/
src/ Unit/ Utility/ WebformYamlTest.php, line 90
Class
- WebformYamlTest
- Tests webform tidy utility.
Namespace
Drupal\Tests\webform\Unit\UtilityCode
public function providerDecode() {
$tests[] = [
"simple: value",
[
'simple' => 'value',
],
];
$tests[] = [
"returns: |\n line 1\n line 2",
[
'returns' => "line 1\nline 2",
],
];
$tests[] = [
"'one two': |\n line 1\n line 2",
[
'one two' => "line 1\nline 2",
],
];
$tests[] = [
"array:\n - one\n - two",
[
'array' => [
'one',
'two',
],
],
];
$tests[] = [
"- one: One\n- two: Two",
[
[
'one' => 'One',
],
[
'two' => 'Two',
],
],
];
$tests[] = [
FALSE,
[],
];
$tests[] = [
NULL,
[],
];
$tests[] = [
[],
[],
];
$tests[] = [
0,
[],
];
return $tests;
}