AmpFormatterFacebookTest.php in Accelerated Mobile Pages (AMP) 8.3
File
tests/src/Functional/AmpFormatterFacebookTest.php
View source
<?php
namespace Drupal\Tests\amp\Functional;
class AmpFormatterFacebookTest extends AmpFormatterTestBase {
protected $ampFormatterType = 'amp_social_post_formatter';
protected $ampFormatterSettings = [
'layout' => 'responsive',
'width' => 16,
'height' => 9,
'provider' => [
'facebook' => 'facebook',
],
'data-embed-as' => 'post',
'data-align-center' => '',
'placeholder' => '',
];
protected $ampElementName = 'amp-facebook';
protected function setUp() {
parent::setUp();
$this
->createTextField($this->fieldName);
$this
->configureDisplay();
}
public function createAmpNode() {
parent::createAmpNode();
$values = [
[
'value' => 'https://www.facebook.com/zuck/posts/10101301165605491',
],
[
'value' => 'https://www.facebook.com/20531316728/posts/10154009990506729',
],
];
$this->node
->set($this->fieldName, $values)
->save();
$this->valuesOut = [
'<amp-facebook layout="responsive" data-embed-as="post" height="9" width="16" data-href="https://www.facebook.com/zuck/posts/10101301165605491">',
'</amp-facebook>',
'<amp-facebook layout="responsive" data-embed-as="post" height="9" width="16" data-href="https://www.facebook.com/20531316728/posts/10154009990506729">',
'</amp-facebook>',
];
}
}