function ImageStylesPathAndUrlTestCase::testImageStylePath
7.x image.test | ImageStylesPathAndUrlTestCase::testImageStylePath() |
Test image_style_path().
File
- drupal-7.x/
modules/ image/ image.test, line 130 - 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.');
}