You are here

public function CarouselServiceTest::testRenderLink in bootstrap simple carousel 8

Tests the renderLink() method.

@covers ::renderLink

@dataProvider providerTestRenderLink

File

tests/src/Unit/Service/CarouselServiceTest.php, line 49

Class

CarouselServiceTest
@coversDefaultClass \Drupal\bootstrap_simple_carousel\Service\CarouselService

Namespace

Drupal\Tests\bootstrap_simple_carousel\Unit\Service

Code

public function testRenderLink(string $url, string $title, array $attributes, array $with, string $expected) {
  $this->renderer
    ->expects($this
    ->exactly(1))
    ->method('render')
    ->with($with)
    ->willReturn($expected);
  $carouselService = new CarouselService($this->renderer, $this->entityTypeManager);
  $actual = $carouselService
    ->renderLink($url, $title, $attributes);
  $this
    ->assertSame($expected, $actual);
}