You are here

public function SimpleFbConnectPostLoginManagerTest::testGetPostLoginPathWithValidQueryParameter in Simple FB Connect 8.3

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/SimpleFbConnectPostLoginManagerTest.php \Drupal\Tests\simple_fb_connect\Unit\SimpleFbConnectPostLoginManagerTest::testGetPostLoginPathWithValidQueryParameter()

Tests getPostLoginPath method with valid query parameter.

@covers ::getPostLoginPath @covers ::validateInternalPath

File

tests/src/Unit/SimpleFbConnectPostLoginManagerTest.php, line 93

Class

SimpleFbConnectPostLoginManagerTest
@coversDefaultClass Drupal\simple_fb_connect\SimpleFbConnectPostLoginManager @group simple_fb_connect

Namespace

Drupal\Tests\simple_fb_connect\Unit

Code

public function testGetPostLoginPathWithValidQueryParameter() {
  $query_path = 'node/1';
  $query_url = $this
    ->generateStubUrl(FALSE, $query_path);
  $this->persistentDataHandler
    ->expects($this
    ->once())
    ->method('get')
    ->with('post_login_path')
    ->willReturn($query_path);
  $this->pathValidator
    ->expects($this
    ->once())
    ->method('getUrlIfValid')
    ->willReturn($query_url);
  $this
    ->assertEquals($query_path, $this->postLoginManager
    ->getPostLoginPath());
}