You are here

public function PermissionsByTermDrupalSubContext::openNodeViewByTitle in Permissions by Term 8.2

@Then /^I open node view by node title "([^"]*)"$/

Parameters

string $title:

File

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

Class

PermissionsByTermDrupalSubContext
Class PermissionsByTermContext

Namespace

Drupal\Tests\permissions_by_term\Behat\PermissionsByTermDrupalSubContext

Code

public function openNodeViewByTitle($title) {
  $query = \Drupal::service('database')
    ->select('node_field_data', 'nfd')
    ->fields('nfd', [
    'nid',
  ])
    ->condition('nfd.title', $title);
  $this
    ->visitPath('/node/' . $query
    ->execute()
    ->fetchField());
}