FormOptionsAttributesTest.php in Form Options Attributes 8
File
tests/modules/form_options_attributes_test/src/Tests/FormOptionsAttributesTest.php
View source
<?php
namespace Drupal\form_options_attributes_test\Tests;
use Drupal\Tests\BrowserTestBase;
class FormOptionsAttributesTest extends BrowserTestBase {
public static $modules = [
'options',
'form_options_attributes',
'form_options_attributes_test',
];
protected $defaultTheme = 'stark';
protected function setUp() {
parent::setUp();
$user = $this
->drupalCreateUser();
$this
->drupalLogin($user);
}
public function testSelect() {
$this
->drupalGet('/form-options-attributes-test');
$this
->assertSession()
->elementAttributeContains('css', 'select option.southeast', 'data-bbq-meat', 'pork');
}
public function testOptGroupSelect() {
$this
->drupalGet('form-options-attributes-test-optgroup');
$this
->assertSession()
->elementAttributeContains('css', 'select option.southeast', 'data-bbq-meat', 'pork');
}
public function testRadios() {
$this
->drupalGet('form-options-attributes-test');
$this
->assertSession()
->elementAttributeContains('css', 'input.southeast.form-radio', 'data-bbq-meat', 'pork');
}
public function testCheckboxes() {
$this
->drupalGet('form-options-attributes-test');
$this
->assertSession()
->elementAttributeContains('css', 'input.southeast.form-checkbox', 'data-bbq-meat', 'pork');
}
}