YamlFormElementOptionsTest.php in YAML Form 8
File
src/Tests/YamlFormElementOptionsTest.php
View source
<?php
namespace Drupal\yamlform\Tests;
use Drupal\simpletest\WebTestBase;
class YamlFormElementOptionsTest extends WebTestBase {
protected static $modules = [
'system',
'user',
'yamlform',
'yamlform_test',
];
public function test() {
global $base_path;
$this
->drupalPostForm('yamlform/test_element_options', [], t('Submit'));
$this
->assertRaw("yamlform_options: { }\nyamlform_options_default_value:\n one: One\n two: Two\n three: Three\nyamlform_options_optgroup:\n 'Group One':\n one: One\n 'Group Two':\n two: Two\n 'Group Three':\n three: Three\nyamlform_element_options_entity: yes_no\nyamlform_element_options_custom:\n one: One\n two: Two\n three: Three");
$this
->drupalPostForm('yamlform/test_element_options', [
'yamlform_element_options_custom[options]' => 'yes_no',
], t('Submit'));
$this
->assertRaw("yamlform_element_options_custom: yes_no");
}
}