You are here

public function MediaEntityImageTest::testMediaEntityImage in Media entity image 8

Tests media entity image.

File

src/Tests/MediaEntityImageTest.php, line 43

Class

MediaEntityImageTest
Tests for media entity image.

Namespace

Drupal\media_entity_image\Tests

Code

public function testMediaEntityImage() {
  $account = $this
    ->drupalCreateUser([
    'access test_entity_browser_for_images entity browser pages',
  ]);
  $this
    ->drupalLogin($account);
  $image = current($this
    ->drupalGetTestFiles('image'));

  // Go to the entity browser iframe link.
  $this
    ->drupalGet('/entity-browser/iframe/test_entity_browser_for_images');
  $edit = [
    'files[upload][]' => $this->container
      ->get('file_system')
      ->realpath($image->uri),
  ];
  $this
    ->drupalPostForm(NULL, $edit, t('Select'));
  $this
    ->assertSession()
    ->pageTextContains('Labels:');
  $this
    ->assertSession()
    ->pageTextNotContains('The media bundle is not configured correctly.');
}