PageConstraint

class PageConstraint extends PHPUnit_Framework_Constraint (View source)

Methods

string html(Crawler|string $crawler)

Make sure we obtain the HTML from the crawler or the response.

string text(Crawler|string $crawler)

Make sure we obtain the HTML from the crawler or the response.

Crawler crawler(Crawler|string $crawler)

Create a crawler instance if the given value is not already a Crawler.

string getEscapedPattern(string $text)

Get the escaped text pattern for the constraint.

void fail(Crawler|string $crawler, string $description, ComparisonFailure $comparisonFailure = null)

Throw an exception for the given comparison and test description.

string getFailureDescription()

Get the description of the failure.

string getReverseFailureDescription()

Returns the reversed description of the failure.

string toString()

Get a string representation of the object.

Details

protected string html(Crawler|string $crawler)

Make sure we obtain the HTML from the crawler or the response.

Parameters

Crawler|string $crawler

Return Value

string

protected string text(Crawler|string $crawler)

Make sure we obtain the HTML from the crawler or the response.

Parameters

Crawler|string $crawler

Return Value

string

protected Crawler crawler(Crawler|string $crawler)

Create a crawler instance if the given value is not already a Crawler.

Parameters

Crawler|string $crawler

Return Value

Crawler

protected string getEscapedPattern(string $text)

Get the escaped text pattern for the constraint.

Parameters

string $text

Return Value

string

protected void fail(Crawler|string $crawler, string $description, ComparisonFailure $comparisonFailure = null)

Throw an exception for the given comparison and test description.

Parameters

Crawler|string $crawler
string $description
ComparisonFailure $comparisonFailure

Return Value

void

Exceptions

PHPUnit_Framework_ExpectationFailedException

protected string getFailureDescription()

Get the description of the failure.

Return Value

string

protected string getReverseFailureDescription()

Returns the reversed description of the failure.

Return Value

string

string toString()

Get a string representation of the object.

Placeholder method to avoid forcing definition of this method.

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.5/Illuminate/Foundation/Testing/Constraints/PageConstraint.html