You are here

function ImagecacheExternalTestCase::testCachingExternalImageUsingManagedFileSystem in Imagecache External 8

Same name and namespace in other branches
  1. 7.2 imagecache_external.test \ImagecacheExternalTestCase::testCachingExternalImageUsingManagedFileSystem()

Test caching an external image using the managed file system.

File

./imagecache_external.test, line 193
Tests for Imagecache External.

Class

ImagecacheExternalTestCase
Tests the functions for working with public/private file schemes.

Code

function testCachingExternalImageUsingManagedFileSystem() {
  variable_set('imagecache_external_management', 'managed');
  if ($path = imagecache_external_generate_path($this->external_image_uri)) {
    $query = db_select('file_managed', 'f')
      ->fields('f', [
      'fid',
    ])
      ->condition('uri', $path)
      ->execute()
      ->fetchCol();
    $fid = array_shift($query);
    $this
      ->assertTrue(!empty($fid), t('Image %original was cached in the managed filesystem with file ID %fid.', [
      '%fid' => $fid,
      '%original' => $this->external_image_uri,
    ]));
  }
}