You are here

protected function ApigeeEdgeFunctionalTestTrait::findLink in Apigee Edge 8

Finds a link on the current page.

Parameters

string $name: Name of the link.

Return value

array An array with two items. The first one is the path, the second one is an associative array of the query parameters.

2 calls to ApigeeEdgeFunctionalTestTrait::findLink()
ApigeeEdgeFunctionalTestTrait::clickLinkProperly in tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php
Implements link clicking properly.
ConfigurationPermissionTest::assertPaths in tests/src/Functional/ConfigurationPermissionTest.php
Checks access to the admin pages.

File

tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php, line 263

Class

ApigeeEdgeFunctionalTestTrait
Provides common functionality for the Apigee Edge test classes.

Namespace

Drupal\Tests\apigee_edge\Traits

Code

protected function findLink(string $name) : array {

  /** @var \Behat\Mink\Element\NodeElement[] $links */
  $links = $this
    ->getSession()
    ->getPage()
    ->findAll('named', [
    'link',
    $name,
  ]);
  $this
    ->assertnotEmpty($links, "Link \"{$name}\" found.");
  $href = $links[0]
    ->getAttribute('href');
  $parts = parse_url($href);
  $query = [];
  parse_str($parts['query'], $query);
  return [
    $parts['path'],
    $query,
  ];
}