function ImageStylesPathAndUrlTest::testImageStylePath
Same name in other branches
- 9 core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php \Drupal\Tests\image\Functional\ImageStylesPathAndUrlTest::testImageStylePath()
- 10 core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php \Drupal\Tests\image\Functional\ImageStylesPathAndUrlTest::testImageStylePath()
- 11.x core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php \Drupal\Tests\image\Functional\ImageStylesPathAndUrlTest::testImageStylePath()
Tests \Drupal\image\ImageStyleInterface::buildUri().
File
-
core/
modules/ image/ tests/ src/ Functional/ ImageStylesPathAndUrlTest.php, line 62
Class
- ImageStylesPathAndUrlTest
- Tests the functions for generating paths and URLs for image styles.
Namespace
Drupal\Tests\image\FunctionalCode
public function testImageStylePath() {
$scheme = 'public';
$actual = $this->style
->buildUri("{$scheme}://foo/bar.gif");
$expected = "{$scheme}://styles/" . $this->style
->id() . "/{$scheme}/foo/bar.gif";
$this->assertEqual($actual, $expected, 'Got the path for a file URI.');
$actual = $this->style
->buildUri('foo/bar.gif');
$expected = "{$scheme}://styles/" . $this->style
->id() . "/{$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.