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

Breadcrumb

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

function StringContains::failureDescription

Overrides Constraint::failureDescription

File

vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php, line 61

Class

StringContains
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework\Constraint

Code

public function failureDescription(mixed $other) : string {
    $stringifiedHaystack = Exporter::export($other, true);
    $haystackEncoding = $this->getDetectedEncoding($other);
    $haystackLength = $this->getHaystackLength($other);
    $haystackInformation = sprintf('%s [%s](length: %s) ', $stringifiedHaystack, $haystackEncoding, $haystackLength);
    $needleInformation = $this->toString(true);
    return $haystackInformation . $needleInformation;
}
RSS feed
Powered by Drupal