You are here

public function AuthmapTest::testGetAuthData in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/AuthmapTest.php \Drupal\Tests\externalauth\Unit\AuthmapTest::testGetAuthData()

Test getAuthData() method.

@covers ::getAuthData @covers ::__construct

File

tests/src/Unit/AuthmapTest.php, line 163

Class

AuthmapTest
Authmap unit tests.

Namespace

Drupal\Tests\externalauth\Unit

Code

public function testGetAuthData() {
  $actual_data = [
    'authname' => "test_authname",
    'data' => "test_data",
  ];
  $this->statement
    ->expects($this
    ->any())
    ->method('fetchAssoc')
    ->will($this
    ->returnValue($actual_data));
  $authmap = new Authmap($this->connection);
  $result = $authmap
    ->getAuthData(2, "test_provider");
  $this
    ->assertEquals([
    'authname' => "test_authname",
    "data" => "test_data",
  ], $result);
}