You are here

public function MediaBrowserUploadWidgetTest::testInvalidInput in Lightning Media 8.3

Overrides MediaBrowserWidgetTestBase::testInvalidInput

File

tests/src/Functional/MediaBrowserUploadWidgetTest.php, line 44

Class

MediaBrowserUploadWidgetTest
@group lightning_media

Namespace

Drupal\Tests\lightning_media\Functional

Code

public function testInvalidInput() {
  $assert_session = $this
    ->assertSession();
  parent::testInvalidInput();
  $assert_session
    ->pageTextContains('You must upload a file.');
  $this
    ->uploadFile(__DIR__ . '/../../files/test.php');
  $assert_session
    ->elementExists('css', '[role="alert"]');
  $assert_session
    ->pageTextContains('Only files with the following extensions are allowed');

  // The error message should not be double-escaped.
  $assert_session
    ->responseNotContains('<em class="placeholder">');
  $this
    ->uploadFile(__DIR__ . '/../../files/test.jpg');
  $assert_session
    ->elementNotExists('css', '[role="alert"]');
}