diff --git a/composer.lock b/composer.lock
index 6c513c4c7e320c06eedb879967b9023291917c76..49bc3ed5e57be487c48c0322e4cb57b4c0fba40b 100644
--- a/composer.lock
+++ b/composer.lock
@@ -5823,17 +5823,17 @@
         },
         {
             "name": "drupal/media_entity_twitter",
-            "version": "2.4.0",
+            "version": "2.6.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/media_entity_twitter.git",
-                "reference": "8.x-2.4"
+                "reference": "8.x-2.6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.4.zip",
-                "reference": "8.x-2.4",
-                "shasum": "11bca09cc6dd678dc7585d16d66167a09c6e42fb"
+                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.6.zip",
+                "reference": "8.x-2.6",
+                "shasum": "777062eb55314da47ee3878db6d10d022e91bed6"
             },
             "require": {
                 "drupal/core": "^8.8 || ^9",
@@ -5841,12 +5841,9 @@
             },
             "type": "drupal-module",
             "extra": {
-                "branch-alias": {
-                    "dev-2.x": "2.x-dev"
-                },
                 "drupal": {
-                    "version": "8.x-2.4",
-                    "datestamp": "1585646747",
+                    "version": "8.x-2.6",
+                    "datestamp": "1610375564",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index b9cff5eff37ad72da99afedbe69535bc4e89d6c9..c7cbb82dd1b579f25c73b391dc3a6890b03a2223 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -5999,18 +5999,18 @@
     },
     {
         "name": "drupal/media_entity_twitter",
-        "version": "2.4.0",
-        "version_normalized": "2.4.0.0",
+        "version": "2.6.0",
+        "version_normalized": "2.6.0.0",
         "source": {
             "type": "git",
             "url": "https://git.drupalcode.org/project/media_entity_twitter.git",
-            "reference": "8.x-2.4"
+            "reference": "8.x-2.6"
         },
         "dist": {
             "type": "zip",
-            "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.4.zip",
-            "reference": "8.x-2.4",
-            "shasum": "11bca09cc6dd678dc7585d16d66167a09c6e42fb"
+            "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.6.zip",
+            "reference": "8.x-2.6",
+            "shasum": "777062eb55314da47ee3878db6d10d022e91bed6"
         },
         "require": {
             "drupal/core": "^8.8 || ^9",
@@ -6018,12 +6018,9 @@
         },
         "type": "drupal-module",
         "extra": {
-            "branch-alias": {
-                "dev-2.x": "2.x-dev"
-            },
             "drupal": {
-                "version": "8.x-2.4",
-                "datestamp": "1585646747",
+                "version": "8.x-2.6",
+                "datestamp": "1610375564",
                 "security-coverage": {
                     "status": "covered",
                     "message": "Covered by Drupal's security advisory policy"
diff --git a/web/modules/media_entity_twitter/media_entity_twitter.info.yml b/web/modules/media_entity_twitter/media_entity_twitter.info.yml
index 0c97051226a80c0915b0e89329ddaabbba4d34a7..03aa469d411658a8a1911666a43a8c437fde586f 100644
--- a/web/modules/media_entity_twitter/media_entity_twitter.info.yml
+++ b/web/modules/media_entity_twitter/media_entity_twitter.info.yml
@@ -6,7 +6,7 @@ core_version_requirement: ^8.8 || ^9
 dependencies:
   - drupal:media
 
-# Information added by Drupal.org packaging script on 2020-03-31
-version: '8.x-2.4'
+# Information added by Drupal.org packaging script on 2021-01-11
+version: '8.x-2.6'
 project: 'media_entity_twitter'
-datestamp: 1585646749
+datestamp: 1610375567
diff --git a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraint.php b/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraint.php
deleted file mode 100644
index 28aca9571f63f2a894a0035fbc440952fe3a371e..0000000000000000000000000000000000000000
--- a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraint.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace Drupal\media_entity_twitter\Plugin\Validation\Constraint;
-
-use Symfony\Component\Validator\Constraint;
-
-/**
- * Checks if a value is a valid Tweet embed code/URL.
- *
- * @Constraint(
- *   id = "TweetEmbedCode",
- *   label = @Translation("Tweet embed code", context = "Validation"),
- *   type = { "link", "string", "string_long" }
- * )
- */
-class TweetEmbedCodeConstraint extends Constraint {
-
-  /**
-   * The default violation message.
-   *
-   * @var string
-   */
-  public $message = 'Not valid Tweet URL/embed code.';
-
-}
diff --git a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraintValidator.php b/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraintValidator.php
deleted file mode 100644
index 699a819416639accfb0f82221d05e101bb512620..0000000000000000000000000000000000000000
--- a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetEmbedCodeConstraintValidator.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-namespace Drupal\media_entity_twitter\Plugin\Validation\Constraint;
-
-use Drupal\media_entity_twitter\Plugin\media\Source\Twitter;
-use Drupal\Core\Field\FieldItemList;
-use Drupal\Core\Field\FieldItemInterface;
-use Symfony\Component\Validator\Constraint;
-use Symfony\Component\Validator\ConstraintValidator;
-
-/**
- * Validates the TweetEmbedCode constraint.
- */
-class TweetEmbedCodeConstraintValidator extends ConstraintValidator {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function validate($value, Constraint $constraint) {
-    $data = '';
-    if (is_string($value)) {
-      $data = $value;
-    }
-    elseif ($value instanceof FieldItemList) {
-      $fieldtype = $value->getFieldDefinition()->getType();
-      $field_value = $value->getValue();
-      if ($fieldtype == 'link') {
-        $data = empty($field_value[0]['uri']) ? "" : $field_value[0]['uri'];
-      }
-      else {
-        $data = empty($field_value[0]['value']) ? "" : $field_value[0]['value'];
-      }
-    }
-    elseif ($value instanceof FieldItemInterface) {
-      $class = get_class($value);
-      $property = $class::mainPropertyName();
-      if ($property) {
-        $data = $value->{$property};
-      }
-    }
-    if ($data) {
-      $matches = [];
-      foreach (Twitter::$validationRegexp as $pattern => $key) {
-        if (preg_match($pattern, $data, $item_matches)) {
-          $matches[] = $item_matches;
-        }
-      }
-      if (empty($matches)) {
-        $this->context->addViolation($constraint->message);
-      }
-    }
-  }
-
-}
diff --git a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraint.php b/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraint.php
deleted file mode 100644
index 2a16846a9d461d013d885d228336fbbce7b161eb..0000000000000000000000000000000000000000
--- a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraint.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace Drupal\media_entity_twitter\Plugin\Validation\Constraint;
-
-use Symfony\Component\Validator\Constraint;
-
-/**
- * Checks if a Tweet is publicly visible.
- *
- * @Constraint(
- *   id = "TweetVisible",
- *   label = @Translation("Tweet publicly visible", context = "Validation"),
- *   type = { "entity", "entity_reference", "string", "string_long" }
- * )
- */
-class TweetVisibleConstraint extends Constraint {
-
-  /**
-   * The default violation message.
-   *
-   * @var string
-   */
-  public $message = 'Referenced tweet is not publicly visible.';
-
-}
diff --git a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraintValidator.php b/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraintValidator.php
deleted file mode 100644
index 81967dab07e16aee442b0743cb16c62a3d90904d..0000000000000000000000000000000000000000
--- a/web/modules/media_entity_twitter/src/Plugin/Validation/Constraint/TweetVisibleConstraintValidator.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-namespace Drupal\media_entity_twitter\Plugin\Validation\Constraint;
-
-use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Field\FieldItemListInterface;
-use Drupal\media_entity_twitter\Plugin\media\Source\Twitter;
-use Drupal\Core\Field\FieldItemInterface;
-use GuzzleHttp\Client;
-use GuzzleHttp\Exception\ClientException;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\Validator\Constraint;
-use Symfony\Component\Validator\ConstraintValidator;
-
-/**
- * Validates the TweetVisible constraint.
- */
-class TweetVisibleConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface {
-
-  /**
-   * The HTTP client to fetch the feed data with.
-   *
-   * @var \GuzzleHttp\Client
-   */
-  protected $httpClient;
-
-  /**
-   * Constructs a new TweetVisibleConstraintValidator.
-   *
-   * @param \GuzzleHttp\Client $http_client
-   *   The http client service.
-   */
-  public function __construct(Client $http_client) {
-    $this->httpClient = $http_client;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static($container->get('http_client'));
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function validate($value, Constraint $constraint) {
-    $data = '';
-    if (is_string($value)) {
-      $data = $value;
-    }
-    elseif ($value instanceof FieldItemListInterface) {
-      $fieldtype = $value->getFieldDefinition()->getType();
-      $field_value = $value->getValue();
-      if ($fieldtype == 'link') {
-        $data = empty($field_value[0]['uri']) ? "" : $field_value[0]['uri'];
-      }
-      else {
-        $data = empty($field_value[0]['value']) ? "" : $field_value[0]['value'];
-      }
-    }
-    elseif ($value instanceof FieldItemInterface) {
-      $class = get_class($value);
-      $property = $class::mainPropertyName();
-      if ($property) {
-        $data = $value->{$property};
-      }
-    }
-    foreach (Twitter::$validationRegexp as $pattern => $key) {
-      if (preg_match($pattern, $data, $item_matches)) {
-        $matches[] = $item_matches;
-      }
-    }
-
-    if (empty($matches[0][0])) {
-      // If there are no matches the URL is not correct, so stop validation.
-      return;
-    }
-
-    // Fetch content from the given url.
-    try {
-      $response = $this->httpClient->get($matches[0][0], ['allow_redirects' => FALSE]);
-    }
-    catch (ClientException $e) {
-      $this->context->addViolation($constraint->message);
-      return;
-    }
-
-    if ($response->getStatusCode() == 302 && ($location = $response->getHeader('location'))) {
-      $effective_url_parts = parse_url($location[0]);
-      if (!empty($effective_url_parts) && isset($effective_url_parts['query']) && $effective_url_parts['query'] == 'protected_redirect=true') {
-        $this->context->addViolation($constraint->message);
-      }
-    }
-  }
-
-}
diff --git a/web/modules/media_entity_twitter/src/Plugin/media/Source/Twitter.php b/web/modules/media_entity_twitter/src/Plugin/media/Source/Twitter.php
index 72018dfee2a72d58c9117bedeb96ce3b35bbb6b6..22abcfeac576bbcb96582ec7aac2cc10777af7d0 100644
--- a/web/modules/media_entity_twitter/src/Plugin/media/Source/Twitter.php
+++ b/web/modules/media_entity_twitter/src/Plugin/media/Source/Twitter.php
@@ -14,6 +14,7 @@
 use Drupal\media\MediaInterface;
 use Drupal\media\MediaSourceBase;
 use Drupal\media\MediaTypeInterface;
+use Drupal\media\Plugin\media\Source\OEmbedInterface;
 use Drupal\media_entity_twitter\TweetFetcherInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
@@ -33,7 +34,7 @@
  *   }
  * )
  */
-class Twitter extends MediaSourceBase implements MediaSourceFieldConstraintsInterface {
+class Twitter extends MediaSourceBase implements MediaSourceFieldConstraintsInterface, OEmbedInterface {
 
   /**
    * The renderer.
@@ -114,6 +115,8 @@ public static function create(ContainerInterface $container, array $configuratio
    *   The tweet fetcher.
    * @param \Drupal\Core\Logger\LoggerChannelInterface $logger
    *   The logger channel.
+   * @param \Drupal\Core\File\FileSystemInterface $file_system
+   *   The file system.
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, FieldTypePluginManagerInterface $field_type_manager, ConfigFactoryInterface $config_factory, RendererInterface $renderer, TweetFetcherInterface $tweet_fetcher, LoggerChannelInterface $logger, FileSystemInterface $file_system) {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $entity_field_manager, $field_type_manager, $config_factory);
@@ -210,7 +213,6 @@ public function getMetadata(MediaInterface $media, $attribute_name) {
         ];
         $svg = $this->renderer->renderRoot($thumbnail);
 
-
         return $this->fileSystem->saveData($svg, $thumbnail_uri, FileSystemInterface::EXISTS_ERROR) ?: parent::getMetadata($media, $attribute_name);
     }
 
@@ -379,8 +381,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
    */
   public function getSourceFieldConstraints() {
     return [
-      'TweetEmbedCode' => [],
-      'TweetVisible' => [],
+      'oembed_resource' => [],
     ];
   }
 
@@ -448,7 +449,7 @@ protected function matchRegexp(MediaInterface $media) {
     $matches = [];
 
     $source_field = $this->getSourceFieldDefinition($media->bundle->entity)->getName();
-    if ($media->hasField($source_field)) {
+    if ($media->hasField($source_field) && !$media->get($source_field)->isEmpty()) {
       $property_name = $media->get($source_field)->first()->mainPropertyName();
       foreach (static::$validationRegexp as $pattern => $key) {
         if (preg_match($pattern, $media->get($source_field)->{$property_name}, $matches)) {
@@ -480,4 +481,11 @@ protected function fetchTweet($id) {
     return $this->tweetFetcher->fetchTweet($id);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getProviders() {
+    return ['Twitter'];
+  }
+
 }
diff --git a/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php b/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php
index 2df19dca8c51235ca5050b61838105d4c0496f4d..e928db8dcd55591de5d214e7c47b3655cb7efadb 100644
--- a/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php
+++ b/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php
@@ -67,14 +67,14 @@ public function testManageEmbedFormatter() {
     ];
     $this->drupalPostForm(NULL, $edit_conf, t('Save and continue'));
     $this->assertSession()
-        ->responseContains('These settings apply to the <em class="placeholder">' . $edit_conf['label'] . '</em> field everywhere it is used.');
+      ->responseContains('These settings apply to the <em class="placeholder">' . $edit_conf['label'] . '</em> field everywhere it is used.');
     $edit = [
       'cardinality' => 'number',
       'cardinality_number' => '1',
     ];
     $this->drupalPostForm(NULL, $edit, t('Save field settings'));
     $this->assertSession()
-        ->responseContains('Updated field <em class="placeholder">' . $edit_conf['label'] . '</em> field settings.');
+      ->responseContains('Updated field <em class="placeholder">' . $edit_conf['label'] . '</em> field settings.');
 
     // Set the new string_long field type as required.
     $edit = [
@@ -82,7 +82,7 @@ public function testManageEmbedFormatter() {
     ];
     $this->drupalPostForm(NULL, $edit, t('Save settings'));
     $this->assertSession()
-        ->responseContains('Saved <em class="placeholder">' . $edit_conf['label'] . '</em> configuration.');
+      ->responseContains('Saved <em class="placeholder">' . $edit_conf['label'] . '</em> configuration.');
 
     // Assert that the new field types configurations have been successfully
     // saved.
@@ -139,7 +139,7 @@ public function testManageEmbedFormatter() {
     // Assert that the link url formatter exists on this page.
     $this->assertSession()->pageTextContains('Tweet URL');
     $this->assertSession()
-        ->responseContains('<a href="https://twitter.com/RamzyStinson/statuses/670650348319576064">', 'Link in embedded Tweet found.');
+      ->responseContains('<a href="https://twitter.com/RamzyStinson/statuses/670650348319576064">', 'Link in embedded Tweet found.');
 
     // Assert that the string_long code formatter exists on this page.
     $this->assertSession()->pageTextContains('Embed code');
diff --git a/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php b/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
index 4c43d24c816980b5e9db62234a46c6837ff1075d..1c0d4b66831f17782f7962aece3b3a99cd2672df 100644
--- a/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
+++ b/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
@@ -107,7 +107,7 @@ protected function setUp() {
       ->get('media_entity_twitter.settings')
       ->get('local_images');
 
-    \Drupal::service('file_system')->prepareDirectory($dir, FileSystemInterface::CREATE_DIRECTORY| FileSystemInterface::MODIFY_PERMISSIONS);
+    \Drupal::service('file_system')->prepareDirectory($dir, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
   }
 
   /**
diff --git a/web/modules/media_entity_twitter/tests/src/Unit/ConstraintsTest.php b/web/modules/media_entity_twitter/tests/src/Unit/ConstraintsTest.php
deleted file mode 100644
index 69e4a1bb0f641ec187b72a584615b4c626625720..0000000000000000000000000000000000000000
--- a/web/modules/media_entity_twitter/tests/src/Unit/ConstraintsTest.php
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-
-namespace Drupal\Tests\media_entity_twitter\Unit;
-
-use Drupal\Core\Field\Plugin\Field\FieldType\StringLongItem;
-use Drupal\Core\TypedData\ComplexDataDefinitionInterface;
-use Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetEmbedCodeConstraint;
-use Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetEmbedCodeConstraintValidator;
-use Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraint;
-use Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraintValidator;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests media_entity_twitter constraints.
- *
- * @group media_entity
- */
-class ConstraintsTest extends UnitTestCase {
-
-  /**
-   * Creates a string_long FieldItemInterface wrapper around a value.
-   *
-   * @param string $value
-   *   The wrapped value.
-   *
-   * @return \Drupal\Core\Field\FieldItemInterface
-   *   Mocked string field item.
-   */
-  protected function getMockFieldItem($value) {
-    $definition = $this->prophesize(ComplexDataDefinitionInterface::class);
-    $definition->getPropertyDefinitions()->willReturn([]);
-
-    $item = new StringLongItem($definition->reveal());
-    $item->set('value', $value);
-
-    return $item;
-  }
-
-  /**
-   * Tests TweetEmbedCode constraint.
-   *
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetEmbedCodeConstraintValidator
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetEmbedCodeConstraint
-   *
-   * @dataProvider embedCodeProvider
-   */
-  public function testTweetEmbedCodeConstraint($embed_code, $expected_violation_count) {
-    // Check message in constraint.
-    $constraint = new TweetEmbedCodeConstraint();
-    $this->assertEquals('Not valid Tweet URL/embed code.', $constraint->message, 'Correct constraint message found.');
-
-    $execution_context = $this->getMockBuilder('\Drupal\Core\TypedData\Validation\ExecutionContext')
-      ->disableOriginalConstructor()
-      ->getMock();
-
-    if ($expected_violation_count) {
-      $execution_context->expects($this->exactly($expected_violation_count))
-        ->method('addViolation')
-        ->with($constraint->message);
-    }
-    else {
-      $execution_context->expects($this->exactly($expected_violation_count))
-        ->method('addViolation');
-    }
-
-    $validator = new TweetEmbedCodeConstraintValidator();
-    $validator->initialize($execution_context);
-
-    $validator->validate($this->getMockFieldItem($embed_code), $constraint);
-  }
-
-  /**
-   * Provides test data for testTweetEmbedCodeConstraint().
-   */
-  public function embedCodeProvider() {
-    return [
-      'valid tweet URL' => ['https://twitter.com/drupal8changes/status/649167396230578176', 0],
-      'valid tweet embed code' => ['<blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">EntityChangedInterface now also defines the function setChangedTime <a href="http://t.co/1Q58UcR8OY">http://t.co/1Q58UcR8OY</a></p>&mdash; Drupal 8 Changes (@drupal8changes) <a href="https://twitter.com/drupal8changes/status/649167396230578176">September 30, 2015</a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>', 0],
-      'invalid URL' => ['https://drupal.org/project/media_entity_twitter', 1],
-      'invalid text' => ['I want my Tweet!', 1],
-      'invalid tweet URL' => ['https://twitter.com/drupal8changes/statustypo/649167396230578176', 1],
-      'invalid tweet ID' => ['https://twitter.com/drupal8changes/status/aa64916739bb6230578176', 1],
-    ];
-  }
-
-  /**
-   * Tests TweetVisible constraint.
-   *
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraintValidator
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraint
-   *
-   * @dataProvider visibleProvider
-   */
-  public function testTweetVisibleConstraint($embed_code, $mocked_response, $violations) {
-    // Check message in constraint.
-    $constraint = new TweetVisibleConstraint();
-    $this->assertEquals('Referenced tweet is not publicly visible.', $constraint->message, 'Correct constraint message found.');
-
-    $http_client = $this->createMock('\GuzzleHttp\Client');
-    $http_client->expects($this->once())
-      ->method('__call')
-      ->with('get', [$embed_code, ['allow_redirects' => FALSE]])
-      ->willReturn($mocked_response);
-
-    // Make sure no violations are raised for visible tweet.
-    $execution_context = $this->getMockBuilder('\Drupal\Core\TypedData\Validation\ExecutionContext')
-      ->disableOriginalConstructor()
-      ->getMock();
-
-    if ($violations) {
-      $execution_context->expects($this->once())
-        ->method('addViolation')
-        ->with($constraint->message);
-    }
-    else {
-      $execution_context->expects($this->exactly($violations))
-        ->method('addViolation');
-    }
-
-    $validator = new TweetVisibleConstraintValidator($http_client);
-    $validator->initialize($execution_context);
-
-    $validator->validate($this->getMockFieldItem($embed_code), $constraint);
-  }
-
-  /**
-   * Provides test data for testTweetVisibleConstraint().
-   */
-  public function visibleProvider() {
-    $visible_response = $this->createMock('\GuzzleHttp\Psr7\Response');
-    $visible_response->expects($this->any())
-      ->method('getStatusCode')
-      ->will($this->returnValue(200));
-
-    $invisible_response = $this->createMock('\GuzzleHttp\Psr7\Response');
-    $invisible_response->expects($this->once())
-      ->method('getStatusCode')
-      ->will($this->returnValue(302));
-    $invisible_response->expects($this->once())
-      ->method('getHeader')
-      ->with('location')
-      ->will($this->returnValue(['https://twitter.com/drupal8changes?protected_redirect=true']));
-
-    return [
-      'valid URL' => [
-        'https://twitter.com/drupal8changes/status/649167396230578176',
-        $visible_response,
-        0,
-      ],
-      'invalid URL' => [
-        'https://twitter.com/drupal8changes/status/649637310024273920',
-        $invisible_response,
-        1,
-      ],
-    ];
-  }
-
-  /**
-   * Tests whether the TweetVisible constraint is robust against bad URLs.
-   *
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraintValidator
-   * @covers \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetVisibleConstraint
-   *
-   * @dataProvider badUrlsProvider
-   */
-  public function testBadUrlsOnVisibleConstraint($embed_code) {
-
-    $http_client = $this->createMock('\GuzzleHttp\Client');
-    $http_client->expects($this->never())
-      ->method('__call')
-      ->with('get', [$embed_code, ['allow_redirects' => FALSE]]);
-
-    $execution_context = $this->getMockBuilder('\Drupal\Core\TypedData\Validation\ExecutionContext')
-      ->disableOriginalConstructor()
-      ->getMock();
-
-    $validator = new TweetVisibleConstraintValidator($http_client);
-    $validator->initialize($execution_context);
-
-    $constraint = new TweetVisibleConstraint();
-    $validator->validate($this->getMockFieldItem($embed_code), $constraint);
-  }
-
-  /**
-   * Provides test data for testBadUrlsOnVisibleConstraint().
-   */
-  public function badUrlsProvider() {
-
-    return [
-      ['https://google.com'],
-      ['https://twitter.com/drupal/ssstatus/725771037837762561'],
-      ['https://twitter.com/drupal/status'],
-      ['https://twitter.com/drupal/status/foo'],
-    ];
-
-  }
-
-}