You are here

public function StatusPageTest::testAuthProviderRequirementsNoToken in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/StatusPageTest.php \Drupal\Tests\salesforce\Functional\StatusPageTest::testAuthProviderRequirementsNoToken()
  2. 5.0.x tests/src/Functional/StatusPageTest.php \Drupal\Tests\salesforce\Functional\StatusPageTest::testAuthProviderRequirementsNoToken()

Test requirements with providers and config, but no token.

File

tests/src/Functional/StatusPageTest.php, line 103

Class

StatusPageTest
Test salesforce_requirements().

Namespace

Drupal\Tests\salesforce\Functional

Code

public function testAuthProviderRequirementsNoToken() {
  $this->authMan
    ->setHasProviders(TRUE);
  $this->authMan
    ->setHasConfig(TRUE);
  $this->authMan
    ->setHasToken(FALSE);
  $requirements = salesforce_get_auth_provider_requirements();
  $this
    ->assertEquals(REQUIREMENT_ERROR, $requirements['severity']);
  $this
    ->assertEquals($this
    ->t('Salesforce authentication failed. Please <a href="@href">check your auth provider settings</a> to connect to Salesforce.', [
    '@href' => Url::fromRoute('entity.salesforce_auth.edit_form', [
      'salesforce_auth' => $this->authMan
        ->getConfig()
        ->id(),
    ])
      ->toString(),
  ]), $requirements['description']);
}