IsSelected
class IsSelected extends FormFieldConstraint (View source)
Properties
protected string | $selector | The name or ID of the element. | from FormFieldConstraint |
protected string | $value | The expected value. | from FormFieldConstraint |
Methods
string | html(Crawler|string $crawler) Make sure we obtain the HTML from the crawler or the response. | from PageConstraint |
string | text(Crawler|string $crawler) Make sure we obtain the HTML from the crawler or the response. | from PageConstraint |
Crawler | crawler(Crawler|string $crawler) Create a crawler instance if the given value is not already a Crawler. | from PageConstraint |
string | getEscapedPattern(string $text) Get the escaped text pattern for the constraint. | from PageConstraint |
void | fail(Crawler|string $crawler, string $description, ComparisonFailure $comparisonFailure = null) Throw an exception for the given comparison and test description. | from PageConstraint |
string | getFailureDescription() Returns the description of the failure. | |
string | getReverseFailureDescription() Returns the reversed description of the failure. | |
string | toString() Get a string representation of the object. | from PageConstraint |
void | __construct(string $selector, mixed $value) Create a new constraint instance. | from FormFieldConstraint |
string | validElements() Get the valid elements. | |
Crawler | field(Crawler $crawler) Get the form field. | from FormFieldConstraint |
array | getElements() Get the elements relevant to the selector. | from FormFieldConstraint |
bool | matches(Crawler|string $crawler) Determine if the select or radio element is selected. | |
array | getSelectedValue(Crawler $crawler) Get the selected value of a select field or radio group. | |
array | getSelectedValueFromSelect(Crawler $select) Get the selected value from a select field. | |
string | getOptionValue(DOMElement $option) Get the selected value from an option element. | |
string|null | getCheckedValueFromRadioGroup(Crawler $radioGroup) Get the checked value from a radio group. |
Details
protected string html(Crawler|string $crawler)
Make sure we obtain the HTML from the crawler or the response.
protected string text(Crawler|string $crawler)
Make sure we obtain the HTML from the crawler or the response.
protected Crawler crawler(Crawler|string $crawler)
Create a crawler instance if the given value is not already a Crawler.
protected string getEscapedPattern(string $text)
Get the escaped text pattern for the constraint.
protected void fail(Crawler|string $crawler, string $description, ComparisonFailure $comparisonFailure = null)
Throw an exception for the given comparison and test description.
protected string getFailureDescription()
Returns the description of the failure.
protected string getReverseFailureDescription()
Returns the reversed description of the failure.
string toString()
Get a string representation of the object.
Placeholder method to avoid forcing definition of this method.
void __construct(string $selector, mixed $value)
Create a new constraint instance.
protected string validElements()
Get the valid elements.
protected Crawler field(Crawler $crawler)
Get the form field.
protected array getElements()
Get the elements relevant to the selector.
protected bool matches(Crawler|string $crawler)
Determine if the select or radio element is selected.
array getSelectedValue(Crawler $crawler)
Get the selected value of a select field or radio group.
protected array getSelectedValueFromSelect(Crawler $select)
Get the selected value from a select field.
protected string getOptionValue(DOMElement $option)
Get the selected value from an option element.
protected string|null getCheckedValueFromRadioGroup(Crawler $radioGroup)
Get the checked value from a radio group.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Foundation/Testing/Constraints/IsSelected.html