You are here

public function EntityBrowserUITest::testEntityBrowserUI in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/EntityBrowserUITest.php \Drupal\Tests\entity_browser\Functional\EntityBrowserUITest::testEntityBrowserUI()

Tests entity browser UI.

File

tests/src/Functional/EntityBrowserUITest.php, line 37

Class

EntityBrowserUITest
Tests the entity browser UI.

Namespace

Drupal\Tests\entity_browser\Functional

Code

public function testEntityBrowserUI() {
  $account = $this
    ->drupalCreateUser([
    'administer entity browsers',
    'access test_entity_browser_iframe entity browser pages',
  ]);
  $this
    ->drupalLogin($account);

  // Go to the entity browser iframe link.
  $this
    ->drupalGet('/entity-browser/iframe/test_entity_browser_iframe');
  $this
    ->assertSession()
    ->responseContains('Select');
  $this
    ->drupalGet('/admin/config/content/entity_browser/test_entity_browser_iframe/widgets');
  $edit = [
    'table[871dbf77-012e-41cb-b32a-ada353d2de35][form][submit_text]' => 'Different',
  ];
  $this
    ->submitForm($edit, 'Save');
  $this
    ->drupalGet('/entity-browser/iframe/test_entity_browser_iframe');
  $this
    ->assertSession()
    ->responseContains('Different');
}