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