You are here

function ImageStylesPathAndUrlTestCase::testImageStylePath in Drupal 7

Test image_style_path().

File

modules/image/image.test, line 148
Tests for image.module.

Class

ImageStylesPathAndUrlTestCase
Tests the functions for generating paths and URLs for image styles.

Code

function testImageStylePath() {
  $scheme = 'public';
  $actual = image_style_path($this->style_name, "{$scheme}://foo/bar.gif");
  $expected = "{$scheme}://styles/" . $this->style_name . "/{$scheme}/foo/bar.gif";
  $this
    ->assertEqual($actual, $expected, 'Got the path for a file URI.');
  $actual = image_style_path($this->style_name, 'foo/bar.gif');
  $expected = "{$scheme}://styles/" . $this->style_name . "/{$scheme}/foo/bar.gif";
  $this
    ->assertEqual($actual, $expected, 'Got the path for a relative file path.');
}