You are here

protected function SocialAuthTestBase::checkPathInBlock in Social Auth 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Functional/SocialAuthTestBase.php \Drupal\Tests\social_auth\Functional\SocialAuthTestBase::checkPathInBlock()

Check if link to path is in the login block.

Parameters

string $path: The path to the start of the authentication process.

1 call to SocialAuthTestBase::checkPathInBlock()
SocialAuthTestBase::checkLinkToProviderExists in tests/src/Functional/SocialAuthTestBase.php
Test if link to provider exists in login block.

File

tests/src/Functional/SocialAuthTestBase.php, line 91

Class

SocialAuthTestBase
Defines a base class for testing Social Auth implementers.

Namespace

Drupal\Tests\social_auth\Functional

Code

protected function checkPathInBlock($path) {
  $links = $this
    ->xpath('//a[contains(@href, :href)]', [
    ':href' => $path,
  ]);
  $this
    ->assertGreaterThanOrEqual(1, count($links));
}