PHP Трейт Illuminate\Foundation\Testing\Concerns\InteractsWithPages

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$crawler Symfony\Component\DomCrawler\Crawler The DomCrawler instance.
$inputs array All of the stored inputs for the current page.
$subCrawlers array Nested crawler instances used by the "within" method.
$uploads array All of the stored uploads for the current page.

Открытые методы

Метод Описание
dontSee ( string $text ) Assert that a given string is not seen on the current HTML.
dontSeeElement ( string $selector, array $attributes = [] ) Assert that an element is not present on the page.
dontSeeInElement ( string $element, string $text ) Assert that a given string is not seen inside an element.
dontSeeInField ( string $selector, string $value ) Assert that an input field does not contain the given value.
dontSeeIsChecked ( string $selector ) Assert that the given checkbox is not selected.
dontSeeIsSelected ( string $selector, string $value ) Assert that the given value is not selected.
dontSeeLink ( string $text, string | null $url = null ) Assert that a given link is not seen on the page.
dontSeeText ( string $text ) Assert that a given string is not seen on the current text.
see ( string $text, boolean $negate = false ) Assert that a given string is seen on the current HTML.
seeElement ( string $selector, array $attributes = [], boolean $negate = false ) Assert that an element is present on the page.
seeInElement ( string $element, string $text, boolean $negate = false ) Assert that a given string is seen inside an element.
seeInField ( string $selector, string $expected, boolean $negate = false ) Assert that an input field contains the given value.
seeIsChecked ( string $selector, boolean $negate = false ) Assert that the given checkbox is selected.
seeIsSelected ( string $selector, string $value, boolean $negate = false ) Assert that the expected value is selected.
seeLink ( string $text, string | null $url = null, boolean $negate = false ) Assert that a given link is seen on the page.
seeText ( string $text, boolean $negate = false ) Assert that a given string is seen on the current text.
visit ( string $uri ) Visit the given URI with a GET request.
visitRoute ( string $route, array $parameters = [] ) Visit the given named route with a GET request.
within ( string $element, Closure $callback ) Narrow the test content to a specific area of the page.

Защищенные методы

Метод Описание
assertFilterProducesResults ( string $filter ) Assert that a filtered Crawler returns nodes.
assertInPage ( Illuminate\Foundation\Testing\Constraints\PageConstraint $constraint, boolean $reverse = false, string $message = '' ) Assert the given constraint.
assertPageLoaded ( string $uri, string | null $message = null ) Assert that a given page successfully loaded.
attach ( string $absolutePath, string $element ) Attach a file to a form field on the page.
check ( string $element ) Check a checkbox on the page.
clearInputs ( ) Clear the inputs for the current page.
click ( string $name ) Click a link with the given body, name, or ID attribute.
convertUploadsForTesting ( Form $form, array $uploads ) : array Convert the given uploads to UploadedFile instances.
crawler ( ) : Crawler Get the current crawler according to the test context.
extractParametersFromForm ( Form $form ) : array Extract the parameters from the given form.
fillForm ( string $buttonText, array $inputs = [] ) : Form Fill the form with the given data.
filterByNameOrId ( string $name, array | string $elements = '*' ) : Crawler Filter elements according to the given name or ID attribute.
followRedirects ( ) Follow redirects from the last response.
getForm ( string | null $buttonText = null ) : Form Get the form from the page with the given submit button text.
getUploadedFileForTesting ( array $file, array $uploads, string $name ) : Illuminate\Http\UploadedFile Create an UploadedFile instance for testing.
makeRequest ( string $method, string $uri, array $parameters = [], array $cookies = [], array $files = [] ) Make a request to the application and create a Crawler instance.
makeRequestUsingForm ( Form $form, array $uploads = [] ) Make a request to the application using the given form.
prepareArrayBasedFileInput ( array &$uploads, string $key, mixed $file ) Store an array based file upload with the proper nested array structure.
press ( string $buttonText ) Submit a form using the button with the given text value.
resetPageContext ( ) Clean the crawler and the subcrawlers values to reset the page context.
seePageIs ( string $uri ) Assert that the current page matches a given URI.
seeRouteIs ( string $route, array $parameters = [] ) Assert that the current page matches a given named route.
select ( string $option, string $element ) Select an option from a drop-down.
storeInput ( string $element, string $text ) Store a form input in the local array.
submitForm ( string $buttonText, array $inputs = [], array $uploads = [] ) Submit a form on the page with the given input.
type ( string $text, string $element ) Fill an input field with the given text.
uncheck ( string $element ) Uncheck a checkbox on the page.

Описание методов

assertFilterProducesResults() защищенный Метод

Assert that a filtered Crawler returns nodes.
protected assertFilterProducesResults ( string $filter )
$filter string

assertInPage() защищенный Метод

Assert the given constraint.
protected assertInPage ( Illuminate\Foundation\Testing\Constraints\PageConstraint $constraint, boolean $reverse = false, string $message = '' )
$constraint Illuminate\Foundation\Testing\Constraints\PageConstraint
$reverse boolean
$message string

assertPageLoaded() защищенный Метод

Assert that a given page successfully loaded.
protected assertPageLoaded ( string $uri, string | null $message = null )
$uri string
$message string | null

attach() защищенный Метод

Attach a file to a form field on the page.
protected attach ( string $absolutePath, string $element )
$absolutePath string
$element string

check() защищенный Метод

Check a checkbox on the page.
protected check ( string $element )
$element string

clearInputs() защищенный Метод

Clear the inputs for the current page.
protected clearInputs ( )

click() защищенный Метод

Click a link with the given body, name, or ID attribute.
protected click ( string $name )
$name string

convertUploadsForTesting() защищенный Метод

Convert the given uploads to UploadedFile instances.
protected convertUploadsForTesting ( Form $form, array $uploads ) : array
$form Symfony\Component\DomCrawler\Form
$uploads array
Результат array

crawler() защищенный Метод

Get the current crawler according to the test context.
protected crawler ( ) : Crawler
Результат Symfony\Component\DomCrawler\Crawler

dontSee() публичный Метод

Assert that a given string is not seen on the current HTML.
public dontSee ( string $text )
$text string

dontSeeElement() публичный Метод

Assert that an element is not present on the page.
public dontSeeElement ( string $selector, array $attributes = [] )
$selector string
$attributes array

dontSeeInElement() публичный Метод

Assert that a given string is not seen inside an element.
public dontSeeInElement ( string $element, string $text )
$element string
$text string

dontSeeInField() публичный Метод

Assert that an input field does not contain the given value.
public dontSeeInField ( string $selector, string $value )
$selector string
$value string

dontSeeIsChecked() публичный Метод

Assert that the given checkbox is not selected.
public dontSeeIsChecked ( string $selector )
$selector string

dontSeeIsSelected() публичный Метод

Assert that the given value is not selected.
public dontSeeIsSelected ( string $selector, string $value )
$selector string
$value string

dontSeeText() публичный Метод

Assert that a given string is not seen on the current text.
public dontSeeText ( string $text )
$text string

extractParametersFromForm() защищенный Метод

Extract the parameters from the given form.
protected extractParametersFromForm ( Form $form ) : array
$form Symfony\Component\DomCrawler\Form
Результат array

fillForm() защищенный Метод

Fill the form with the given data.
protected fillForm ( string $buttonText, array $inputs = [] ) : Form
$buttonText string
$inputs array
Результат Symfony\Component\DomCrawler\Form

filterByNameOrId() защищенный Метод

Filter elements according to the given name or ID attribute.
protected filterByNameOrId ( string $name, array | string $elements = '*' ) : Crawler
$name string
$elements array | string
Результат Symfony\Component\DomCrawler\Crawler

followRedirects() защищенный Метод

Follow redirects from the last response.
protected followRedirects ( )

getForm() защищенный Метод

Get the form from the page with the given submit button text.
protected getForm ( string | null $buttonText = null ) : Form
$buttonText string | null
Результат Symfony\Component\DomCrawler\Form

getUploadedFileForTesting() защищенный Метод

Create an UploadedFile instance for testing.
protected getUploadedFileForTesting ( array $file, array $uploads, string $name ) : Illuminate\Http\UploadedFile
$file array
$uploads array
$name string
Результат Illuminate\Http\UploadedFile

makeRequest() защищенный Метод

Make a request to the application and create a Crawler instance.
protected makeRequest ( string $method, string $uri, array $parameters = [], array $cookies = [], array $files = [] )
$method string
$uri string
$parameters array
$cookies array
$files array

makeRequestUsingForm() защищенный Метод

Make a request to the application using the given form.
protected makeRequestUsingForm ( Form $form, array $uploads = [] )
$form Symfony\Component\DomCrawler\Form
$uploads array

prepareArrayBasedFileInput() защищенный Метод

Store an array based file upload with the proper nested array structure.
protected prepareArrayBasedFileInput ( array &$uploads, string $key, mixed $file )
$uploads array
$key string
$file mixed

press() защищенный Метод

Submit a form using the button with the given text value.
protected press ( string $buttonText )
$buttonText string

resetPageContext() защищенный Метод

Clean the crawler and the subcrawlers values to reset the page context.
protected resetPageContext ( )

see() публичный Метод

Assert that a given string is seen on the current HTML.
public see ( string $text, boolean $negate = false )
$text string
$negate boolean

seeElement() публичный Метод

Assert that an element is present on the page.
public seeElement ( string $selector, array $attributes = [], boolean $negate = false )
$selector string
$attributes array
$negate boolean

seeInElement() публичный Метод

Assert that a given string is seen inside an element.
public seeInElement ( string $element, string $text, boolean $negate = false )
$element string
$text string
$negate boolean

seeInField() публичный Метод

Assert that an input field contains the given value.
public seeInField ( string $selector, string $expected, boolean $negate = false )
$selector string
$expected string
$negate boolean

seeIsChecked() публичный Метод

Assert that the given checkbox is selected.
public seeIsChecked ( string $selector, boolean $negate = false )
$selector string
$negate boolean

seeIsSelected() публичный Метод

Assert that the expected value is selected.
public seeIsSelected ( string $selector, string $value, boolean $negate = false )
$selector string
$value string
$negate boolean

seePageIs() защищенный Метод

Assert that the current page matches a given URI.
protected seePageIs ( string $uri )
$uri string

seeRouteIs() защищенный Метод

Assert that the current page matches a given named route.
protected seeRouteIs ( string $route, array $parameters = [] )
$route string
$parameters array

seeText() публичный Метод

Assert that a given string is seen on the current text.
public seeText ( string $text, boolean $negate = false )
$text string
$negate boolean

select() защищенный Метод

Select an option from a drop-down.
protected select ( string $option, string $element )
$option string
$element string

storeInput() защищенный Метод

Store a form input in the local array.
protected storeInput ( string $element, string $text )
$element string
$text string

submitForm() защищенный Метод

Submit a form on the page with the given input.
protected submitForm ( string $buttonText, array $inputs = [], array $uploads = [] )
$buttonText string
$inputs array
$uploads array

type() защищенный Метод

Fill an input field with the given text.
protected type ( string $text, string $element )
$text string
$element string

uncheck() защищенный Метод

Uncheck a checkbox on the page.
protected uncheck ( string $element )
$element string

visit() публичный Метод

Visit the given URI with a GET request.
public visit ( string $uri )
$uri string

visitRoute() публичный Метод

Visit the given named route with a GET request.
public visitRoute ( string $route, array $parameters = [] )
$route string
$parameters array

within() публичный Метод

Narrow the test content to a specific area of the page.
public within ( string $element, Closure $callback )
$element string
$callback Closure

Описание свойств

$crawler защищенное свойство

The DomCrawler instance.
protected Crawler,Symfony\Component\DomCrawler $crawler
Результат Symfony\Component\DomCrawler\Crawler

$inputs защищенное свойство

All of the stored inputs for the current page.
protected array $inputs
Результат array

$subCrawlers защищенное свойство

Nested crawler instances used by the "within" method.
protected array $subCrawlers
Результат array

$uploads защищенное свойство

All of the stored uploads for the current page.
protected array $uploads
Результат array