You are here

public function BynderApiUnitTest::providerHasAccessToken in Bynder 8.3

Same name and namespace in other branches
  1. 8 tests/src/Unit/BynderApiUnitTest.php \Drupal\Tests\bynder\Unit\BynderApiUnitTest::providerHasAccessToken()
  2. 8.2 tests/src/Unit/BynderApiUnitTest.php \Drupal\Tests\bynder\Unit\BynderApiUnitTest::providerHasAccessToken()
  3. 4.0.x tests/src/Unit/BynderApiUnitTest.php \Drupal\Tests\bynder\Unit\BynderApiUnitTest::providerHasAccessToken()

Data provider for testHasAccessToken().

File

tests/src/Unit/BynderApiUnitTest.php, line 43

Class

BynderApiUnitTest
@coversDefaultClass \Drupal\bynder\BynderApi

Namespace

Drupal\Tests\bynder\Unit

Code

public function providerHasAccessToken() {
  $data = [];
  $data['no_session_data'] = [
    [],
    'valid_hash',
    0,
    FALSE,
  ];
  $data['no_token'] = [
    [
      'access_token' => [
        'oauth_token_secret' => 'secret',
      ],
    ],
    'valid_hash',
    0,
    FALSE,
  ];
  $data['no_secret'] = [
    [
      'access_token' => [
        'oauth_token' => 'token',
      ],
    ],
    'valid_hash',
    0,
    FALSE,
  ];
  $data['no_hash'] = [
    [
      'access_token' => [
        'oauth_token' => 'token',
        'oauth_token_secret' => 'secret',
      ],
    ],
    'valid_hash',
    0,
    FALSE,
  ];
  $data['valid'] = [
    [
      'access_token' => [
        'oauth_token' => 'token',
        'oauth_token_secret' => 'secret',
      ],
      'config_hash' => 'valid_hash',
    ],
    'valid_hash',
    1,
    TRUE,
  ];
  return $data;
}