You are here

public function BlazyUnitTest::providerBuildAttributes in Blazy 8

Provider for ::testBuildAttributes.

File

tests/src/Unit/BlazyUnitTest.php, line 163

Class

BlazyUnitTest
@coversDefaultClass \Drupal\blazy\Blazy

Namespace

Drupal\Tests\blazy\Unit

Code

public function providerBuildAttributes() {
  $uri = 'public://example.jpg';
  $data[] = [
    [
      'background' => FALSE,
      'uri' => '',
    ],
    FALSE,
    FALSE,
  ];
  $data[] = [
    [
      'background' => FALSE,
      'responsive_image_style_id' => 'blazy_responsive_test',
      'uri' => $uri,
    ],
    TRUE,
    FALSE,
  ];
  $data[] = [
    [
      'background' => TRUE,
      'uri' => $uri,
    ],
    FALSE,
    FALSE,
  ];
  $data[] = [
    [
      'background' => FALSE,
      'ratio' => 'fluid',
      'sizes' => '100w',
      'width' => 640,
      'height' => 360,
      'uri' => $uri,
    ],
    TRUE,
    FALSE,
  ];
  $data[] = [
    [
      'background' => FALSE,
      'embed_url' => '//www.youtube.com/watch?v=E03HFA923kw',
      'media_switch' => 'media',
      'ratio' => 'fluid',
      'sizes' => '100w',
      'scheme' => 'youtube',
      'type' => 'video',
      'uri' => $uri,
    ],
    TRUE,
    TRUE,
  ];
  return $data;
}