Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExpectationException.php

function ExpectationException::trimBody

Removes response header/footer, letting only <body /> content.

Parameters

string $string response content:

Return value

string

1 call to ExpectationException::trimBody()
ExpectationException::getContext in vendor/behat/mink/src/Exception/ExpectationException.php
Gets the context rendered for this exception.

File

vendor/behat/mink/src/Exception/ExpectationException.php, line 136

Class

ExpectationException
Exception thrown for failed expectations.

Namespace

Behat\Mink\Exception

Code

protected function trimBody($string) {
    $string = preg_replace(array(
        '/^.*<body>/s',
        '/<\\/body>.*$/s',
    ), array(
        '<body>',
        '</body>',
    ), $string) ?? $string;
    return $string;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal