You are here

public function MinisiteTestBase::getTestArchiveValid in Mini site 8

Shorthand to get a valid archive file.

Return value

\Drupal\file\Entity\File The File entity object.

4 calls to MinisiteTestBase::getTestArchiveValid()
FieldValidationTest::testValidateRequired in tests/src/Functional/FieldValidationTest.php
Tests the required property on minisite field.
MinisiteTest::testMinisiteInstance in tests/src/Functional/MinisiteTest.php
Test working with Minisite class instance.
MinisiteTest::testMissingFile in tests/src/Functional/MinisiteTest.php
Test that missing physical file throws exception.
MinisiteTestBase::createFieldAndNode in tests/src/Functional/MinisiteTestBase.php
Create Minisite field through UI and upload a fixture archive.

File

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

Class

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

Namespace

Drupal\Tests\minisite\Functional

Code

public function getTestArchiveValid() {

  // Create valid fixture archive.
  // All files must reside in the top-level directory, archive must contain
  // index.html file, and files should have allowed extension.
  $archive_file_absolute = $this
    ->fixtureCreateArchive($this
    ->getTestFilesStubValid());
  return $this
    ->convertToFileEntity($archive_file_absolute);
}