You are here

public function AuthmapTest::testGetUid 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::testGetUid()

Test getUid() method.

@covers ::getUid @covers ::__construct

File

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

Class

AuthmapTest
Authmap unit tests.

Namespace

Drupal\Tests\externalauth\Unit

Code

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