You are here

public function TwitterProfileTest::queryDataProvider in Twitter Profile Widget 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/TwitterProfileTest.php \Drupal\Tests\twitter_profile_widget\Unit\TwitterProfileTest::queryDataProvider()
  2. 3.x tests/src/Unit/TwitterProfileTest.php \Drupal\Tests\twitter_profile_widget\Unit\TwitterProfileTest::queryDataProvider()

Data provider for testQuery().

File

tests/src/Unit/TwitterProfileTest.php, line 61

Class

TwitterProfileTest
Tests the "TwitterProfile" service, which builds Twitter API queries.

Namespace

Drupal\Tests\twitter_profile_widget\Unit

Code

public function queryDataProvider() {
  return [
    [
      [
        'account' => 'testuser',
        'type' => 'timeline',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 1,
        'retweets' => 1,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/lists/statuses.json',
        'getfield' => '?count=10&slug=mytimeline&owner_screen_name=testuser&include_rts=1',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'timeline',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 0,
        'retweets' => 0,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/lists/statuses.json',
        'getfield' => '?count=10&slug=mytimeline&owner_screen_name=testuser&include_rts=0&exclude_replies=1',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'search',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 1,
        'retweets' => 1,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/search/tweets.json',
        'getfield' => '?q=search+param&count=10',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'search',
        'timeline' => 'mytimeline',
        'search' => '#search . param%',
        'replies' => 1,
        'retweets' => 1,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/search/tweets.json',
        'getfield' => '?q=%23search+.+param%25&count=10',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'favorites',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 1,
        'retweets' => 1,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/favorites/list.json',
        'getfield' => '?count=10&screen_name=testuser',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'status',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 1,
        'retweets' => 1,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/statuses/user_timeline.json',
        'getfield' => '?count=10&screen_name=testuser&include_rts=1',
      ],
    ],
    [
      [
        'account' => 'testuser',
        'type' => 'status',
        'timeline' => 'mytimeline',
        'search' => 'search param',
        'replies' => 0,
        'retweets' => 0,
      ],
      [
        'url' => 'https://api.twitter.com/1.1/statuses/user_timeline.json',
        'getfield' => '?count=10&screen_name=testuser&include_rts=0&exclude_replies=1',
      ],
    ],
  ];
}