PHP Класс Zizaco\TestCases\ControllerTestCase

Наследование: extends TestCase
Показать файл Открыть проект

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

Свойство Тип Описание
$crawler Symfony\Component\DomCrawler\Crawler The Synfony's DomCrawler of the last request
$lastException Symfony\Component\HttpKernel\Exception\HttpException Will the last HttpException caught
$requestInput array Will contain the parameters of the next request

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

Метод Описание
assertBodyHasHtml ( $needle )
assertBodyHasNotText ( $needle )
assertBodyHasText ( $needle )
assertRedirection ( $location = null ) : void Asserts if page was redirected correctly
assertRequestOk ( ) : void Asserts if the request was Ok (200)
assertSessionHas ( string $name, mixed $value = null ) : void. Asserts if the session variable is correct
assertStatusCode ( $code ) : void Asserts if the status code is correct
getBodyHtml ( )
getBodyText ( )
requestAction ( string $method, string $action, $params = [] ) : ControllerTestCase Request an URL by the action name
requestUrl ( string $method, string $url, $params = [] ) : ControllerTestCase Request an URL
setUp ( ) Set session and enable Laravel filters
withInput ( array $params ) : mixed Set the post parameters and return this for chainable method call

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

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

public assertBodyHasHtml ( $needle )

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

public assertBodyHasNotText ( $needle )

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

public assertBodyHasText ( $needle )

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

Asserts if page was redirected correctly
public assertRedirection ( $location = null ) : void
$location Location where it should be redirected
Результат void

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

Asserts if the request was Ok (200)
public assertRequestOk ( ) : void
Результат void

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

Asserts if the session variable is correct
public assertSessionHas ( string $name, mixed $value = null ) : void.
$name string Session variable name.
$value mixed Session variable value.
Результат void.

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

Asserts if the status code is correct
public assertStatusCode ( $code ) : void
$code Correct status code
Результат void

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

public getBodyHtml ( )

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

public getBodyText ( )

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

Request an URL by the action name
public requestAction ( string $method, string $action, $params = [] ) : ControllerTestCase
$method string
$action string
Результат ControllerTestCase this for method chaining.

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

Request an URL
public requestUrl ( string $method, string $url, $params = [] ) : ControllerTestCase
$method string
$url string
Результат ControllerTestCase this for method chaining.

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

Set session and enable Laravel filters
public setUp ( )

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

Set the post parameters and return this for chainable method call
public withInput ( array $params ) : mixed
$params array Post paratemers array.
Результат mixed this.

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

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

The Synfony's DomCrawler of the last request
protected Symfony\Component\DomCrawler\Crawler $crawler
Результат Symfony\Component\DomCrawler\Crawler

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

Will the last HttpException caught
protected HttpException,Symfony\Component\HttpKernel\Exception $lastException
Результат Symfony\Component\HttpKernel\Exception\HttpException

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

Will contain the parameters of the next request
protected array $requestInput
Результат array