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\ConstraintCode
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;
}