Completed
Push — 8.x-1.x ( 70f2d6...17b03a )
by Janez
02:51
created

EntityBrowserUITest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testEntityBrowserUI() 0 19 1
1
<?php
2
3
namespace Drupal\entity_browser\Tests;
4
5
use Drupal\simpletest\WebTestBase;
6
7
/**
8
 * Tests the entity browser UI.
9
 *
10
 * @group entity_browser
11
 */
12
class EntityBrowserUITest extends WebTestBase {
13
14
  /**
15
   * Modules to enable.
16
   *
17
   * @var array
18
   */
19
  public static $modules = [
20
    'entity_browser_test',
21
    'ctools',
22
    'views',
23
    'block',
24
  ];
25
26
  /**
27
   * Tests entity browser UI.
28
   */
29
  public function testEntityBrowserUI() {
30
    $account = $this->drupalCreateUser([
31
      'administer entity browsers',
32
      'access test_entity_browser_iframe entity browser pages',
33
    ]);
34
    $this->drupalLogin($account);
35
    // Go to the entity browser iframe link.
36
    $this->drupalGet('/entity-browser/iframe/test_entity_browser_iframe');
37
    $this->assertRaw('Select');
38
    $this->drupalGet('/admin/config/content/entity_browser/test_entity_browser_iframe');
39
    $edit = [
40
      'submit_text' => 'Different',
41
    ];
42
    $this->drupalPostForm(NULL, $edit, 'Next');
43
    $this->drupalGet('/admin/config/content/entity_browser/test_entity_browser_iframe/widgets');
44
    $this->drupalPostForm(NULL, [], 'Finish');
45
    $this->drupalGet('/entity-browser/iframe/test_entity_browser_iframe');
46
    $this->assertRaw('Different');
47
  }
48
49
}
50