1 image.test ImageStylesPathAndUrlUnitTest::testImageStylePath()

Test image_style_path().

File

core/modules/image/tests/image.test, line 127
Tests for image.module.

Class

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