You are here

public function MinisiteTestBase::getUploadedArchiveFile in Mini site 8

Get uploaded archive file.

Parameters

\Drupal\node\Entity\Node $node: The node object to get the file from.

string $field_name: Field name without 'field_' prefix.

Return value

\Drupal\file\Entity\File|null Uploaded file or NULL.

4 calls to MinisiteTestBase::getUploadedArchiveFile()
MinisiteTestBase::assertMinisiteRemoved in tests/src/Functional/MinisiteTestBase.php
Assert that a Minisite archive and assets were removed.
MinisiteTestBase::assertMinisiteUploaded in tests/src/Functional/MinisiteTestBase.php
Assert that Minisite archive file was uploaded and assets expanded.
UploadBrowseTest::testUploadAndBrowsing in tests/src/Functional/UploadBrowseTest.php
Tests ZIP file upload and browsing minisite pages.
UploadBrowseTest::testUploadAndRemoval in tests/src/Functional/UploadBrowseTest.php
Tests ZIP file upload and removal, without removing a node.

File

tests/src/Functional/MinisiteTestBase.php, line 466

Class

MinisiteTestBase
Provides methods specifically for testing Minisite module's field handling.

Namespace

Drupal\Tests\minisite\Functional

Code

public function getUploadedArchiveFile(Node $node, $field_name) {
  return File::load($node->{'field_' . $field_name}->target_id);
}