Commit a64818c8 authored by Kim Pepper's avatar Kim Pepper Committed by Kim Pepper
Browse files

Issue #3317292 by kim.pepper: Add Drupal 10 compatibility

parent 5052bd0c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
  "homepage": "https://github.com/acbramley/twitter_api",
  "license": "GPL-2.0+",
  "require": {
    "drupal/core": "^8.7.7 || ^9",
    "j7mbo/twitter-api-php": "^1.0.6"
  }
}
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
namespace Drupal\twitter_api;

/**
 * Interface TwitterApiClientInterface.
 * Provides an interface for Twitter API clients.
 */
interface TwitterApiClientInterface {

+0 −5
Original line number Diff line number Diff line
oauth_access_token: '871599208423346176-PDmeFjAL6Gs8chsvmZtLSBRVFaGuJTZ'
oauth_access_token_secret: 'uOjqHDS3x4LlbKKByYyPAJwiQN0iNOmzXkd6XzSElAGYt'
consumer_key: 'jPm5FlH9473oL2oWrDzKiVxcV'
consumer_secret: 'trv0OaEbCJpFHizCwo8VLs7RLDrqec6eknDVYUvOlEbuDYrbYb'
api_url: 'https://api.twitter.com/1.1/'
+0 −4
Original line number Diff line number Diff line
type: module
name: Twitter API Test
description: Provides test settings for twitter api testing.
core_version_requirement: ^8 || ^9
+0 −47
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\twitter_api\Kernel;

use Drupal\KernelTests\KernelTestBase;

/**
 * Kernel tests for the twitter API client.
 *
 * @group twitter_api
 */
class TwitterApiClientTest extends KernelTestBase {

  /**
   * Our client to test.
   *
   * @var \Drupal\twitter_api\TwitterApiClientInterface
   */
  protected $client;

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'twitter_api',
    'twitter_api_test',
  ];

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();
    $this->installConfig('twitter_api_test');
    $this->client = \Drupal::service('twitter_api.client');
  }

  /**
   * Tests the get tweets function.
   */
  public function testGetTweets() {
    $tweets = $this->client->getTweets(['screen_name' => 'drupaltestacc', 'count' => 1]);
    $this->assertNotEmpty($tweets);
    $this->assertStringContainsString('This is a test tweet', $tweets[0]['text']);
  }

}
Loading