Mink example

/** * Set up the Mink session manager. * * @return \Behat\Mink\Session */
  protected function initMink() {
    $client = new DrupalTestBrowser();
    $client->followMetaRefresh(TRUE);
    $driver = new BrowserKitDriver($client);
    $session = new Session($driver);
    $this->mink = new Mink();
    $this->mink->registerSession('default', $session);
    $this->mink->setDefaultSessionName('default');
    $session->start();
    return $session;
  }

  /** * Get the Mink instance. * * Use the Mink object to perform assertions against the content returned by a * request. * * @return \Behat\Mink\Mink * The Mink object. */
      // performed in the test.       $handler_stack = $client->getConfig('handler');
      $handler_stack->push($this->getResponseLogHandler());

      $driver->getClient()->setClient($client);
    }

    $selectors_handler = new SelectorsHandler([
      'hidden_field_selector' => new HiddenFieldSelector(),
    ]);
    $session = new Session($driver$selectors_handler);
    $this->mink = new Mink();
    $this->mink->registerSession('default', $session);
    $this->mink->setDefaultSessionName('default');
    $this->registerSessions();

    $this->initFrontPage();

    // Copies cookies from the current environment, for example, XDEBUG_SESSION     // in order to support Xdebug.     // @see BrowserTestBase::initFrontPage()     $cookies = $this->extractCookiesFromRequest(\Drupal::request());
    foreach ($cookies as $cookie_name => $values) {
      
Home | Imprint | This part of the site doesn't use cookies.