You are here

function ImagecacheExternalTestCase::testCachingExternalImageUsingManagedFileSystem in Imagecache External 7.2

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

Test caching an external image using the managed file system.

File

./imagecache_external.test, line 217
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['url'])) {
    $query = db_select('file_managed', 'f')
      ->fields('f', array(
      '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.', array(
      '%fid' => $fid,
      '%original' => $this->external_image['url'],
    )));
  }
}