You are here

public function MultipleValuesTest::testUploadThenRemoveFiles in FileField Sources 8

Tests uploading then removing files.

File

tests/src/Functional/MultipleValuesTest.php, line 88

Class

MultipleValuesTest
Tests multiple sources on multiple values field.

Namespace

Drupal\Tests\filefield_sources\Functional

Code

public function testUploadThenRemoveFiles() {
  $this
    ->uploadFiles();

  // Remove all uploaded files.
  $this
    ->removeFile('INSTALL.txt', 0);
  $this
    ->removeFile($this->permanentFileEntity1
    ->getFilename(), 0);
  $this
    ->removeFile($this->temporaryFile->filename, 0);
  $this
    ->removeFile($this->temporaryFileEntity2
    ->getFilename(), 0);
  $this
    ->removeFile($this->temporaryFileEntity1
    ->getFilename(), 0);
  $this
    ->removeFile($this->permanentFileEntity2
    ->getFilename(), 0);

  // Ensure all files have been removed.
  $this
    ->assertNoFieldByXPath('//input[@type="submit"]', t('Remove'), 'All files have been removed.');
}