public function CarouselServiceTest::providerTestRenderImageById in bootstrap simple carousel 8
Provides test data for providerTestRenderImageById.
Return value
array The test data.
File
- tests/
src/ Unit/ Service/ CarouselServiceTest.php, line 109
Class
- CarouselServiceTest
- @coversDefaultClass \Drupal\bootstrap_simple_carousel\Service\CarouselService
Namespace
Drupal\Tests\bootstrap_simple_carousel\Unit\ServiceCode
public function providerTestRenderImageById() {
$url = 'public://directory/file.jpg';
$file = $this
->createMock(FileInterface::class);
$file
->expects($this
->once())
->method('getFileUri')
->willReturn($url);
$imageStyle = 'style_slider';
$params = [
'alt' => 'alt',
'title' => 'title',
];
$with = [
'#theme' => 'image_style',
'#style_name' => $imageStyle,
'#uri' => $url,
'#alt' => $params['alt'],
'#title' => $params['title'],
];
return [
[
5,
$file,
$imageStyle,
$params,
$with,
1,
'/directory/file.jpg',
],
[
33,
NULL,
$imageStyle,
$params,
$with,
0,
'',
],
];
}