From b88e056861a965232c7d7933988496e0440d30d1 Mon Sep 17 00:00:00 2001
From: "lee.5151" <lee.5151@osu.edu>
Date: Mon, 28 Nov 2022 13:01:15 -0500
Subject: [PATCH] Upgrading drupal/media_entity_twitter (2.7.0 => 2.9.0)

---
 composer.json                                 |  2 +-
 composer.lock                                 | 18 +++----
 vendor/composer/installed.json                | 34 ++++++-------
 vendor/composer/installed.php                 | 10 ++--
 web/modules/media_entity_twitter/.travis.yml  | 50 -------------------
 .../media_entity_twitter/DEVELOPING.md        |  6 ---
 .../media_entity_twitter.info.yml             |  8 +--
 .../media_entity_twitter.install              |  4 +-
 .../src/Plugin/media/Source/Twitter.php       |  8 +--
 .../Functional/TweetEmbedFormatterTest.php    | 16 +++---
 .../tests/src/Kernel/ThumbnailTest.php        |  4 +-
 11 files changed, 53 insertions(+), 107 deletions(-)
 delete mode 100644 web/modules/media_entity_twitter/.travis.yml
 delete mode 100644 web/modules/media_entity_twitter/DEVELOPING.md

diff --git a/composer.json b/composer.json
index fdb70b8e51..42def658ef 100644
--- a/composer.json
+++ b/composer.json
@@ -134,7 +134,7 @@
         "drupal/mathjax": "3.0.0",
         "drupal/media_entity_browser": "2.0-alpha3",
         "drupal/media_entity_file_replace": "^1.0",
-        "drupal/media_entity_twitter": "2.7",
+        "drupal/media_entity_twitter": "2.9",
         "drupal/menu_block": "1.7",
         "drupal/menu_breadcrumb": "1.16",
         "drupal/metatag": "1.16",
diff --git a/composer.lock b/composer.lock
index 9f77354148..f4568df3de 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "34725321c1b77f13acdd41e96c52fb5d",
+    "content-hash": "99498650bc74bef42484f17ed99d640c",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -5449,27 +5449,27 @@
         },
         {
             "name": "drupal/media_entity_twitter",
-            "version": "2.7.0",
+            "version": "2.9.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/media_entity_twitter.git",
-                "reference": "8.x-2.7"
+                "reference": "8.x-2.9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.7.zip",
-                "reference": "8.x-2.7",
-                "shasum": "6a2dec14a8fc1ebb88188e5b9b1afbd310342854"
+                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.9.zip",
+                "reference": "8.x-2.9",
+                "shasum": "1f10bb3bed1fcb112c2226bea214ae1d33b4a3ab"
             },
             "require": {
-                "drupal/core": "^8.8 || ^9",
+                "drupal/core": "^9 || ^10",
                 "j7mbo/twitter-api-php": "~1.0"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "8.x-2.7",
-                    "datestamp": "1614676236",
+                    "version": "8.x-2.9",
+                    "datestamp": "1669304993",
                     "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 ffdd21e445..c71a3f822e 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -5634,28 +5634,28 @@
         },
         {
             "name": "drupal/media_entity_twitter",
-            "version": "2.7.0",
-            "version_normalized": "2.7.0.0",
+            "version": "2.9.0",
+            "version_normalized": "2.9.0.0",
             "source": {
                 "type": "git",
                 "url": "https://git.drupalcode.org/project/media_entity_twitter.git",
-                "reference": "8.x-2.7"
+                "reference": "8.x-2.9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.7.zip",
-                "reference": "8.x-2.7",
-                "shasum": "6a2dec14a8fc1ebb88188e5b9b1afbd310342854"
+                "url": "https://ftp.drupal.org/files/projects/media_entity_twitter-8.x-2.9.zip",
+                "reference": "8.x-2.9",
+                "shasum": "1f10bb3bed1fcb112c2226bea214ae1d33b4a3ab"
             },
             "require": {
-                "drupal/core": "^8.8 || ^9",
+                "drupal/core": "^9 || ^10",
                 "j7mbo/twitter-api-php": "~1.0"
             },
             "type": "drupal-module",
             "extra": {
                 "drupal": {
-                    "version": "8.x-2.7",
-                    "datestamp": "1614676236",
+                    "version": "8.x-2.9",
+                    "datestamp": "1669304993",
                     "security-coverage": {
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
@@ -5668,22 +5668,22 @@
                 "GPL-2.0-or-later"
             ],
             "authors": [
-                {
-                    "name": "Drupal Media Team",
-                    "homepage": "https://www.drupal.org/user/3260690"
-                },
-                {
-                    "name": "Primsi",
-                    "homepage": "https://www.drupal.org/user/282629"
-                },
                 {
                     "name": "chr.fritsch",
                     "homepage": "https://www.drupal.org/user/2103716"
                 },
+                {
+                    "name": "Drupal Media Team",
+                    "homepage": "https://www.drupal.org/user/3260690"
+                },
                 {
                     "name": "phenaproxima",
                     "homepage": "https://www.drupal.org/user/205645"
                 },
+                {
+                    "name": "Primsi",
+                    "homepage": "https://www.drupal.org/user/282629"
+                },
                 {
                     "name": "slashrsm",
                     "homepage": "https://www.drupal.org/user/744628"
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index bddb3ca2ac..b1dbc38d50 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
         'name' => 'osu-asc-webservices/d8-upstream',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '429f72e15c8ceea994931b8d1abf14e67c0e8c20',
+        'reference' => 'b32d6543d3f3958296e85fa3c3e6faf263f8a478',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -956,9 +956,9 @@
             'dev_requirement' => false,
         ),
         'drupal/media_entity_twitter' => array(
-            'pretty_version' => '2.7.0',
-            'version' => '2.7.0.0',
-            'reference' => '8.x-2.7',
+            'pretty_version' => '2.9.0',
+            'version' => '2.9.0.0',
+            'reference' => '8.x-2.9',
             'type' => 'drupal-module',
             'install_path' => __DIR__ . '/../../web/modules/media_entity_twitter',
             'aliases' => array(),
@@ -1594,7 +1594,7 @@
         'osu-asc-webservices/d8-upstream' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '429f72e15c8ceea994931b8d1abf14e67c0e8c20',
+            'reference' => 'b32d6543d3f3958296e85fa3c3e6faf263f8a478',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
diff --git a/web/modules/media_entity_twitter/.travis.yml b/web/modules/media_entity_twitter/.travis.yml
deleted file mode 100644
index 5b459a1a29..0000000000
--- a/web/modules/media_entity_twitter/.travis.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-# @file
-# .travis.yml - Drupal for Travis CI Integration
-#
-# Template provided by https://github.com/LionsAd/drupal_ti.
-#
-# Based for simpletest upon:
-#   https://github.com/sonnym/travis-ci-drupal-module-example
-
-language: php
-sudo: false
-
-cache:
-  directories:
-    - $HOME/.composer/cache
-
-php:
-  - 5.5
-  - 5.6
-  - 7
-  - hhvm
-
-matrix:
-  fast_finish: true
-
-branches:
-  only:
-    - "8.x-1.x"
-
-env:
-  global:
-    # add composer's global bin directory to the path
-    # see: https://github.com/drush-ops/drush#install---composer
-    - PATH="$PATH:$HOME/.composer/vendor/bin"
-
-before_install:
-  - composer self-update
-  # Codesniffer and Coder
-  - composer global require "squizlabs/php_codesniffer:2.0.*@dev"
-  - composer global require drupal/coder:8.2.0-beta1
-  - ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/
-
-script:
-  - phpcs --report=full --standard=Drupal "$TRAVIS_BUILD_DIR" || true
-  - cd ~/
-  - git clone --depth 1 --branch 8.0.x http://git.drupal.org/project/drupal.git
-  - cd drupal/modules
-  - git clone --depth 1 --branch 8.x-1.x http://git.drupal.org/project/media_entity.git
-  - ln -s $TRAVIS_BUILD_DIR
-  - cd ../
-  - ./vendor/bin/phpunit -c core modules/media_entity_twitter/tests/src/Unit
diff --git a/web/modules/media_entity_twitter/DEVELOPING.md b/web/modules/media_entity_twitter/DEVELOPING.md
deleted file mode 100644
index c5fa6401f1..0000000000
--- a/web/modules/media_entity_twitter/DEVELOPING.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Developing
-
-* Issues should be filed at
-  http://drupal.org/project/issues/media_entity_twitter
-* Pull requests can be made against
-  https://github.com/drupal-media/media_entity_twitter/pulls
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 77bb3cc80c..b93620ce22 100644
--- a/web/modules/media_entity_twitter/media_entity_twitter.info.yml
+++ b/web/modules/media_entity_twitter/media_entity_twitter.info.yml
@@ -2,11 +2,11 @@ name: Media Entity Twitter
 description: 'Media Entity Twitter provider.'
 type: module
 package: Media
-core_version_requirement: ^8.8 || ^9
+core_version_requirement: ^9 || ^10
 dependencies:
   - drupal:media
 
-# Information added by Drupal.org packaging script on 2021-03-02
-version: '8.x-2.7'
+# Information added by Drupal.org packaging script on 2022-11-24
+version: '8.x-2.9'
 project: 'media_entity_twitter'
-datestamp: 1614676238
+datestamp: 1669304996
diff --git a/web/modules/media_entity_twitter/media_entity_twitter.install b/web/modules/media_entity_twitter/media_entity_twitter.install
index d56b65fb6c..6160b811c1 100644
--- a/web/modules/media_entity_twitter/media_entity_twitter.install
+++ b/web/modules/media_entity_twitter/media_entity_twitter.install
@@ -11,7 +11,9 @@
  * Implements hook_install().
  */
 function media_entity_twitter_install() {
-  $source = drupal_get_path('module', 'media_entity_twitter') . '/images/icons';
+  /** @var \Drupal\Core\Extension\ModuleExtensionList $extension_list */
+  $extension_list = \Drupal::service("extension.list.module");
+  $source = dirname($extension_list->getPathname('media_entity_twitter')) . '/images/icons';
   $destination = \Drupal::config('media.settings')->get('icon_base_uri');
   \Drupal::service('file_system')->prepareDirectory($destination, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
 
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 baa6b25974..6f53bbecba 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
@@ -8,7 +8,7 @@
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\File\FileSystemInterface;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Logger\LoggerChannelInterface;
+use Psr\Log\LoggerInterface;
 use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
 use Drupal\Core\Render\RendererInterface;
 use Drupal\media\MediaInterface;
@@ -113,12 +113,12 @@ public static function create(ContainerInterface $container, array $configuratio
    *   The renderer.
    * @param \Drupal\media_entity_twitter\TweetFetcherInterface $tweet_fetcher
    *   The tweet fetcher.
-   * @param \Drupal\Core\Logger\LoggerChannelInterface $logger
+   * @param \Psr\Log\LoggerInterface $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) {
+  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, LoggerInterface $logger, FileSystemInterface $file_system) {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $entity_field_manager, $field_type_manager, $config_factory);
     $this->renderer = $renderer;
     $this->tweetFetcher = $tweet_fetcher;
@@ -133,11 +133,11 @@ public function defaultConfiguration() {
     return [
       'source_field' => '',
       'use_twitter_api' => FALSE,
-      'generate_thumbnails' => FALSE,
       'consumer_key' => '',
       'consumer_secret' => '',
       'oauth_access_token' => '',
       'oauth_access_token_secret' => '',
+      'generate_thumbnails' => FALSE,
     ];
   }
 
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 e928db8dcd..55b49950c3 100644
--- a/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php
+++ b/web/modules/media_entity_twitter/tests/src/Functional/TweetEmbedFormatterTest.php
@@ -16,7 +16,7 @@ class TweetEmbedFormatterTest extends MediaFunctionalTestBase {
    *
    * @var array
    */
-  public static $modules = [
+  protected static $modules = [
     'media_entity_twitter',
     'link',
   ];
@@ -65,14 +65,14 @@ public function testManageEmbedFormatter() {
       'label' => 'Embed code',
       'field_name' => 'embed_code',
     ];
-    $this->drupalPostForm(NULL, $edit_conf, t('Save and continue'));
+    $this->submitForm($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.');
     $edit = [
       'cardinality' => 'number',
       'cardinality_number' => '1',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save field settings'));
+    $this->submitForm($edit, t('Save field settings'));
     $this->assertSession()
       ->responseContains('Updated field <em class="placeholder">' . $edit_conf['label'] . '</em> field settings.');
 
@@ -80,7 +80,7 @@ public function testManageEmbedFormatter() {
     $edit = [
       'required' => TRUE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save settings'));
+    $this->submitForm($edit, t('Save settings'));
     $this->assertSession()
       ->responseContains('Saved <em class="placeholder">' . $edit_conf['label'] . '</em> configuration.');
 
@@ -108,7 +108,7 @@ public function testManageEmbedFormatter() {
       'fields[field_embed_code][label]' => 'above',
       'fields[field_embed_code][type]' => 'twitter_embed',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->submitForm($edit, t('Save'));
     $this->assertSession()->responseContains('Your settings have been saved.');
 
     // Create and save the media with a twitter media code.
@@ -130,7 +130,7 @@ public function testManageEmbedFormatter() {
       'field_media_twitter[0][value]' => $tweet_url,
       'field_embed_code[0][value]' => $tweet,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
+    $this->submitForm($edit, t('Save'));
     $this->drupalGet('media/1');
 
     // Assert that the media has been successfully saved.
@@ -139,11 +139,11 @@ 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">');
 
     // Assert that the string_long code formatter exists on this page.
     $this->assertSession()->pageTextContains('Embed code');
-    $this->assertSession()->responseContains('<blockquote class="twitter-tweet', 'Embedded Tweet found.');
+    $this->assertSession()->responseContains('<blockquote class="twitter-tweet');
   }
 
 }
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 1c0d4b6683..15a59f7f04 100644
--- a/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
+++ b/web/modules/media_entity_twitter/tests/src/Kernel/ThumbnailTest.php
@@ -42,7 +42,7 @@ class ThumbnailTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = [
+  protected static $modules = [
     'field',
     'file',
     'image',
@@ -56,7 +56,7 @@ class ThumbnailTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
     $this->installEntitySchema('file');
     $this->installEntitySchema('media');
-- 
GitLab