You are here

public function PermissionsByTermContext::openNodeEditFormByTitle in Permissions by Term 8

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

Parameters

string $title:

File

tests/src/Behat/Context/PermissionsByTermContext.php, line 132

Class

PermissionsByTermContext
Class PermissionsByTermContext

Namespace

Drupal\Tests\permissions_by_term\Behat\Context

Code

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