You are here

public function EmptyValuesTest::testAllSourcesEnabled in FileField Sources 8

Tests all sources enabled.

File

tests/src/Functional/EmptyValuesTest.php, line 34

Class

EmptyValuesTest
Tests empty values.

Namespace

Drupal\Tests\filefield_sources\Functional

Code

public function testAllSourcesEnabled() {

  // Change allowed number of values.
  $this
    ->drupalPostForm('admin/structure/types/manage/' . $this->typeName . '/fields/node.' . $this->typeName . '.' . $this->fieldName . '/storage', [
    'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
  ], t('Save field settings'));
  $this
    ->enableSources([
    'upload' => TRUE,
    'remote' => TRUE,
    'clipboard' => TRUE,
    'reference' => TRUE,
    'attach' => TRUE,
    'imce' => TRUE,
  ]);

  // Upload a file by 'Remote' source.
  $this
    ->uploadFileByRemoteSource();

  // Upload a file by 'Reference' source.
  $this
    ->uploadFileByReferenceSource();

  // Upload a file by 'Clipboard' source.
  $this
    ->uploadFileByClipboardSource();

  // Upload a file by 'Attach' source.
  $this
    ->uploadFileByAttachSource();

  // Upload a file by 'Upload' source.
  $this
    ->uploadFileByUploadSource('', '', 0, TRUE);

  // Upload a file by 'Imce' source.
  $this
    ->uploadFileByImceSource();
  $this
    ->assertUniqueSubmitButtons();
}