src/Constraints/PageConstraint.php
protected function fail($crawler, $description, ComparisonFailure $comparisonFailure = null): void
    {
        $html = $this->html($crawler);

        $failureDescription = sprintf(
            "%s\n\n\nFailed asserting that %s",
            $html, $this->getFailureDescription()
        );

        if (! empty($description)) {
            $failureDescription .= ": {$description}";
        }

        if (trim($html) != '') {
            $failureDescription .= '. Please check the content above.';
        } else {
            $failureDescription .= '. The response is empty.';
        }

        throw new ExpectationFailedException($failureDescription, $comparisonFailure);
    }
protected function fail($crawler, $description, ComparisonFailure $comparisonFailure = null): void
    {
        $html = $this->html($crawler);

        $failureDescription = sprintf(
            "%s\n\n\nFailed asserting that %s",
            $html, $this->getFailureDescription()
        );

        if (! empty($description)) {
            $failureDescription .= ": {$description}";
        }

        if (trim($html) != '') {
            $failureDescription .= '. Please check the content above.';
        } else {
            $failureDescription .= '. The response is empty.';
        }

        throw new ExpectationFailedException($failureDescription, $comparisonFailure);
    }
protected function fail ( $ crawler , $ description , ComparisonFailure $ comparisonFailure = null ) : void { $ html = $ this -> html ( $ crawler ) ; $ failureDescription = sprintf ( "%s\n\n\nFailed asserting that %s" , $ html , $ this -> getFailureDescription ( ) ) ; if ( ! empty ( $ description ) ) { $ failureDescription .= ": {$description}" ; } if ( trim ( $ html ) != '' ) { $ failureDescription .= '. Please check the content above.' ; } else { $ failureDescription .= '. The response is empty.' ; } throw new ExpectationFailedException ( $ failureDescription , $ comparisonFailure ) ; }
Throw an exception for the given comparison and test description.

@param  \Symfony\Component\DomCrawler\Crawler|string  $crawler
@param  string  $description
@param  \SebastianBergmann\Comparator\ComparisonFailure|null  $comparisonFailure
@return void

@throws \PHPUnit\Framework\ExpectationFailedException
Throw an exception for the given comparison and test description .