You are here

protected function TextimageTestTrait::getTextimageUrlFromStyleAndText in Textimage 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/TextimageTestTrait.php \Drupal\Tests\textimage\Kernel\TextimageTestTrait::getTextimageUrlFromStyleAndText()

Returns the Url object of a Textimage based on style name and text.

File

tests/src/Kernel/TextimageTestTrait.php, line 147

Class

TextimageTestTrait
Trait to manage Textimage setup tasks common across tests.

Namespace

Drupal\Tests\textimage\Kernel

Code

protected function getTextimageUrlFromStyleAndText($style_name, $text) {
  return $this->textimageFactory
    ->get()
    ->setStyle(ImageStyle::load($style_name))
    ->process($text)
    ->getUrl();
}