You are here

public function LingotekMediaBulkFormTest::testThumbnailsShownOnListing in Lingotek Translation 3.1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  2. 4.0.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  3. 3.0.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  4. 3.2.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  5. 3.3.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  6. 3.4.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  7. 3.5.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  8. 3.6.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  9. 3.7.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()
  10. 3.8.x tests/src/Functional/Form/LingotekMediaBulkFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekMediaBulkFormTest::testThumbnailsShownOnListing()

File

tests/src/Functional/Form/LingotekMediaBulkFormTest.php, line 77

Class

LingotekMediaBulkFormTest
Tests the bulk management form integration with Media.

Namespace

Drupal\Tests\lingotek\Functional\Form

Code

public function testThumbnailsShownOnListing() {
  $test_image = current($this
    ->getTestFiles('image'));

  // Create a media item.
  $edit = [];
  $edit['name[0][value]'] = 'Llamas are cool';
  $edit['langcode[0][value]'] = 'en';
  $edit['files[field_media_image_0]'] = \Drupal::service('file_system')
    ->realpath($test_image->uri);
  $this
    ->drupalPostForm('media/add/image', $edit, 'field_media_image_0_upload_button');
  unset($edit['files[field_media_image_0]']);
  $edit['field_media_image[0][alt]'] = 'Llamas are cool';
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));
  $this
    ->goToContentBulkManagementForm('media');
  $this
    ->assertText('Thumbnail');
  $elements = $this
    ->xpath("//img[@alt='Llamas are cool']");
  $this
    ->assertEqual(1, count($elements), "Found thumbnail.");
}