ExtraFieldFormUITest.php in Extra Field 8.2
File
tests/src/Functional/ExtraFieldFormUITest.php
View source
<?php
namespace Drupal\Tests\extra_field\Functional;
class ExtraFieldFormUITest extends ExtraFieldBrowserTestBase {
public static $modules = [
'extra_field',
'extra_field_test',
'node',
'field_ui',
];
protected $entityFrom;
protected $manageFormUrl;
protected function setUp() {
parent::setUp();
$adminUser = $this
->drupalCreateUser([
'administer node form display',
]);
$this
->drupalLogin($adminUser);
$this->entityFrom['first_node_type'] = $this
->setupContentEntityForm('first_node_type');
$this->manageFormUrl['first_node_type'] = 'admin/structure/types/manage/first_node_type/form-display';
$this->entityFrom['another_node_type'] = $this
->setupContentEntityForm('another_node_type');
$this->manageFormUrl['another_node_type'] = 'admin/structure/types/manage/another_node_type/form-display';
}
public function testOneNodeTypePlugin() {
$this
->drupalGet($this->manageFormUrl['first_node_type']);
$this
->assertSession()
->pageTextContains('Single item test');
$this
->assertSession()
->fieldValueEquals('fields[extra_field_single_item_test][region]', 'content');
$this
->assertSession()
->fieldValueEquals('fields[extra_field_single_item_test][weight]', '-30');
$this
->drupalGet($this->manageFormUrl['another_node_type']);
$this
->assertSession()
->pageTextContains('Single item test');
}
}