protected function MultipleValuesTest::setUp in FileField Sources 8
Sets up for multiple values test case.
Overrides FileFieldSourcesTestBase::setUp
File
- tests/
src/ Functional/ MultipleValuesTest.php, line 59
Class
- MultipleValuesTest
- Tests multiple sources on multiple values field.
Namespace
Drupal\Tests\filefield_sources\FunctionalCode
protected function setUp() {
parent::setUp();
$this
->setUpImce();
// Create test files.
$this->permanentFileEntity1 = $this
->createPermanentFileEntity();
$this->permanentFileEntity2 = $this
->createPermanentFileEntity();
$this->temporaryFileEntity1 = $this
->createTemporaryFileEntity();
$this->temporaryFileEntity2 = $this
->createTemporaryFileEntity();
$path = \Drupal::config('system.file')
->get('default_scheme') . '://' . FILEFIELD_SOURCE_ATTACH_DEFAULT_PATH . '/';
$this->temporaryFile = $this
->createTemporaryFile($path);
// 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,
]);
}