You are here

public function AmpSocialPostTest::renderData in Accelerated Mobile Pages (AMP) 8.3

Provides render data.

Return value

array

File

tests/src/Unit/AmpSocialPostTest.php, line 222

Class

AmpSocialPostTest
@coversDefaultClass \Drupal\amp\Element\AmpSocialPost

Namespace

Drupal\Tests\amp\Unit

Code

public function renderData() {
  $values = [
    'Facebook element' => [
      [
        '#type' => 'amp_social_post',
        '#url' => 'https://www.facebook.com/ParksCanada/posts/1712989015384373',
        '#attributes' => [
          'data-embed-as' => 'post',
          'data-align-center' => 'true',
        ],
      ],
      [
        '#type' => 'amp_social_post',
        '#url' => 'https://www.facebook.com/ParksCanada/posts/1712989015384373',
        '#attributes' => [
          'data-embed-as' => 'post',
          'data-align-center' => 'true',
          'data-href' => 'https://www.facebook.com/ParksCanada/posts/1712989015384373',
        ],
        '#provider' => 'facebook',
        '#attached' => [
          'library' => [
            'amp/amp.facebook',
          ],
        ],
      ],
    ],
  ];
  return $values;
}