You are here

public function AuthmapTest::testGet in External Authentication 2.0.x

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

Test get() method.

@covers ::get @covers ::__construct

File

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

Class

AuthmapTest
Authmap unit tests.

Namespace

Drupal\Tests\externalauth\Unit

Code

public function testGet() {
  $actual_data = (object) [
    'authname' => "test_authname",
  ];
  $this->statement
    ->expects($this
    ->any())
    ->method('fetchObject')
    ->will($this
    ->returnValue($actual_data));
  $authmap = new Authmap($this->connection);
  $result = $authmap
    ->get(2, "test_provider");
  $this
    ->assertEquals($result, "test_authname");
}