You are here

function FileURLRewritingTest::testShippedFileURL in SimpleTest 7

Test the generating of rewritten shipped file URLs.

File

tests/file.test, line 1953
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Class

FileURLRewritingTest
Tests for file URL rewriting.

Code

function testShippedFileURL() {

  // Test generating an URL to a shipped file (i.e. a file that is part of
  // Drupal core, a module or a theme, for example a JavaScript file).
  $filepath = 'misc/jquery.js';
  $url = file_create_url($filepath);
  $this
    ->assertEqual(FILE_URL_TEST_CDN_1 . '/' . $filepath, $url, t('Correctly generated a URL for a shipped file.'));
  $filepath = 'misc/favicon.ico';
  $url = file_create_url($filepath);
  $this
    ->assertEqual(FILE_URL_TEST_CDN_2 . '/' . $filepath, $url, t('Correctly generated a URL for a shipped file.'));
}