You are here

public function MultipleValuesTest::testUploadFilesThenSaveNode in FileField Sources 8

Tests uploading files and saving node.

File

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

Class

MultipleValuesTest
Tests multiple sources on multiple values field.

Namespace

Drupal\Tests\filefield_sources\Functional

Code

public function testUploadFilesThenSaveNode() {
  $this
    ->uploadFiles();
  $this
    ->drupalPostForm(NULL, [
    'title[0][value]' => $this
      ->randomMachineName(),
  ], t('Save'));

  // Ensure all files are saved to node.
  $this
    ->assertLink('INSTALL.txt');
  $this
    ->assertLink($this->permanentFileEntity1
    ->getFilename());
  $this
    ->assertLink($this->temporaryFile->filename);
  $this
    ->assertLink($this->temporaryFileEntity2
    ->getFilename());
  $this
    ->assertLink($this->temporaryFileEntity1
    ->getFilename());
  $this
    ->assertLink($this->permanentFileEntity2
    ->getFilename());
}