ImageResourceUrlTest.php in GraphQL 8.4
File
tests/src/Kernel/DataProducer/Images/ImageResourceUrlTest.php
View source
<?php
namespace Drupal\Tests\graphql\Kernel\DataProducer\Images;
use Drupal\Tests\graphql\Kernel\GraphQLTestBase;
class ImageResourceUrlTest extends GraphQLTestBase {
public function testImageResourceUrl(array $input, string $expected) : void {
$result = $this
->executeDataProducer('image_style_url', [
'derivative' => $input,
]);
$this
->assertEquals($expected, $result);
}
public function testImageResourceUrlProvider() : array {
return [
[
[
'url' => 'http://localhost/test_image.jpg',
],
'http://localhost/test_image.jpg',
],
[
[],
'',
],
];
}
}