You are here

protected function CropUnitTestBase::getTestFile in Crop API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/CropUnitTestBase.php \Drupal\Tests\crop\Kernel\CropUnitTestBase::getTestFile()

Creates and gets test image file.

Return value

\Drupal\file\FileInterface File object.

5 calls to CropUnitTestBase::getTestFile()
CropCRUDTest::testCropSave in tests/src/Kernel/CropCRUDTest.php
Tests crop save.
CropCRUDTest::testOrphanRemoval in tests/src/Kernel/CropCRUDTest.php
Tests automatic removal of orphaned crops.
CropEffectTest::testCropDimenssions in tests/src/Kernel/CropEffectTest.php
Test image crop effect dimensions.
CropEffectTest::testCropEffect in tests/src/Kernel/CropEffectTest.php
Tests manual crop image effect.
CropEntityProvidersTest::testCropEffect in tests/src/Kernel/CropEntityProvidersTest.php
Tests file provider plugin.

File

tests/src/Kernel/CropUnitTestBase.php, line 115

Class

CropUnitTestBase
Tests the crop entity CRUD operations.

Namespace

Drupal\Tests\crop\Kernel

Code

protected function getTestFile() {
  file_unmanaged_copy(drupal_get_path('module', 'crop') . '/tests/files/sarajevo.png', PublicStream::basePath());
  return $this->fileStorage
    ->create([
    'uri' => 'public://sarajevo.png',
    'status' => FILE_STATUS_PERMANENT,
  ]);
}