MockProvider.php in Video Embed Field 8
File
tests/modules/video_embed_field_mock_provider/src/Plugin/video_embed_field/Provider/MockProvider.php
View source
<?php
namespace Drupal\video_embed_field_mock_provider\Plugin\video_embed_field\Provider;
use Drupal\video_embed_field\ProviderPluginInterface;
class MockProvider implements ProviderPluginInterface {
public static function isApplicable($input) {
return strpos($input, 'example.com') !== FALSE;
}
public function renderThumbnail($image_style, $link_url) {
return [
'#markup' => 'Mock provider thumbnail.',
];
}
public function renderEmbedCode($width, $height, $autoplay) {
return [
'#markup' => 'Mock provider embed code.',
];
}
public function getRemoteThumbnailUrl() {
return '';
}
public function getLocalThumbnailUri() {
return '';
}
public function downloadThumbnail() {
return TRUE;
}
public static function getIdFromInput($input) {
return $input;
}
public function getName() {
return 'Video Name';
}
public function getPluginId() {
return 'foo';
}
public function getPluginDefinition() {
return [];
}
}