You are here

public function PermissionsByTermDrupalSubContext::openTaxonomyTermPageByTermName in Permissions by Term 8.2

@Then /^I open taxonomy term view by term name "([^"]*)"$/

File

tests/src/Behat/Context/permissions_by_term.behat.inc, line 408

Class

PermissionsByTermDrupalSubContext
Class PermissionsByTermContext

Namespace

Drupal\Tests\permissions_by_term\Behat\PermissionsByTermDrupalSubContext

Code

public function openTaxonomyTermPageByTermName(string $termName) {
  $query = \Drupal::service('database')
    ->select('taxonomy_term_field_data', 'ttfd')
    ->fields('ttfd', [
    'tid',
  ])
    ->condition('ttfd.name', $termName);
  $this
    ->visitPath('/taxonomy/term/' . $query
    ->execute()
    ->fetchField());
}