function ImageStylesPathAndUrlTestCase::testImageStylePath

Test image_style_path().

File

modules/image/image.test, line 153

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.