BaseWebTest

Extends \sonrac\FCoverage\OnceMigrationWebTest

Class BaseWebTest.

Base class for web functional tests.

package

Default

Methods

Find and boot class traits.

_boot() 
inherited
Throws
\ReflectionException

Find and un-boot traits.

_unBoot() 
inherited
author

Donii Sergii doniysa@gmail.com

Throws
\ReflectionException

Check method exists in trait and call it.

checkTraits(string $prefix = '') 
inherited
author

Donii Sergii doniysa@gmail.com

Throws
\ReflectionException

Arguments

$prefix

string

Method name prefix

Clear global arrays.

clear() 
inherited

{@inheritdoc}

createApplication() 
inherited

Calls a DELETE URI.

delete(string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited

Arguments

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

Rollback migrations.

downMigrationTrait() 
inherited static
author

Donii Sergii doniysa@gmail.com

Throws
\Exception

Calls a GET URI.

get(string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited

Arguments

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

getAllowRedirect

getAllowRedirect() : boolean|integer
inherited
author

Donii Sergii doniysa@gmail.com

Response

boolean|integer

Get test application instance.

getAppClass() : \sonrac\FCoverage\TestApplication
inherited abstract

Get database connection.

getConnection() : \Doctrine\DBAL\Connection
inherited
author

Donii Sergii doniysa@gmail.com

Response

\Doctrine\DBAL\Connection

Get count redirects.

getCountRedirects() : integer
inherited
author

Donii Sergii doniysa@gmail.com

Response

integer

Get response object.

getResponseObject() : \Symfony\Component\HttpFoundation\Response|null
inherited
author

Donii Sergii doniysa@gmail.com

Response

\Symfony\Component\HttpFoundation\Response|null

Increment count redirects.

incrementCountRedirects() 
inherited
author

Donii Sergii doniysa@gmail.com

Init migration trait.

initInitMigrationAppTrait() 
inherited static
author

Donii Sergii doniysa@gmail.com

Throws
\Exception

Get is need clear count redirects.

isClearCountRedirects() : boolean
inherited
author

Donii Sergii doniysa@gmail.com

Response

boolean

Check is thrown exception on redirect.

isThrowExceptionOnRedirect() : boolean
inherited
author

Donii Sergii doniysa@gmail.com

Response

boolean

Calls a PATCH URI.

patch(string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited

Arguments

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

Calls a POST URI.

post(string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited

Arguments

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

Prepare migrations before run.

prepareMigrations() 
inherited static
author

Donii Sergii doniysa@gmail.com

Calls a PUT URI.

put(string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited

Arguments

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

Calls a URI.

request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, boolean $changeHistory = true) : $this
inherited abstract

Arguments

$method

string

The request method

$uri

string

The URI to fetch

$parameters

array

The Request parameters

$files

array

The files

$server

array

The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)

$content

string

The raw body data

$changeHistory

boolean

Whether to update the history or not (only used internally for back(), forward(), and reload())

Response

$this

See in table count records.

seeCountInTable(string $table, integer $count, array|null $params = null) : $this
inherited
author

Donii Sergii doniysa@gmail.com

Arguments

$table

string

$count

integer

$params

array|null

Response

$this

See header in response.

seeHeader(string $header, null $value = null) : $this
inherited

Arguments

$header

string

$value

null

Response

$this

See in database.

seeInDatabase(string $table, array|string $condition) : $this
inherited
author

Donii Sergii doniysa@gmail.com

Throws
\PHPUnit\Framework\AssertionFailedError

Arguments

$table

string

Table name.

$condition

array|string

Where condition.

Response

$this

See json structure.

seeJsonStructure(array $struct, array $data = null) : $this
inherited

Arguments

$struct

array

$data

array

Response

$this

See status code in response.

seeStatusCode(integer $statusCode) : $this
inherited
Throws
\PHPUnit\Framework\AssertionFailedError

Arguments

$statusCode

integer

Response

$this

setAllowRedirect

setAllowRedirect(boolean|integer $allowRedirect) 
inherited
author

Donii Sergii doniysa@gmail.com

Arguments

$allowRedirect

boolean|integer

Set application.

setApplication(\Silex\Application $app) 
author

Donii Sergii doniysa@gmail.com

Arguments

$app

\Silex\Application

Get is need clear count redirects.

setClearCountRedirects(boolean $clear) : $this
inherited
author

Donii Sergii doniysa@gmail.com

Arguments

$clear

boolean

Response

$this

Set count redirects.

setCountRedirects(integer $_countRedirects) 
inherited
author

Donii Sergii doniysa@gmail.com

Arguments

$_countRedirects

integer

Set thrown exception on redirect.

setThrowExceptionOnRedirect(boolean $throwExceptionOnRedirect) 
inherited
author

Donii Sergii doniysa@gmail.com

Arguments

$throwExceptionOnRedirect

boolean

{@inheritdoc}

setUp() 
Throws
\ReflectionException

{@inheritdoc}

setUpBeforeClass() 
inherited static
Throws
\Exception

{@inheritdoc}

tearDown() 
Throws
\ReflectionException

{@inheritdoc}

tearDownAfterClass() 
inherited static
Throws
\Exception

Properties

Http client object.

client : null|\Symfony\Component\HttpKernel\Client
var

Type(s)

null|\Symfony\Component\HttpKernel\Client

Response object.

response : null|\Symfony\Component\HttpFoundation\Response
var

Type(s)

null|\Symfony\Component\HttpFoundation\Response

Crawler instance.

crawler : null|\Symfony\Component\DomCrawler\Crawler
var

Type(s)

null|\Symfony\Component\DomCrawler\Crawler

If false - disable redirects. If number - max enabled redirects count.

allowRedirect : boolean|integer
inherited
var
author

Donii Sergii doniysa@gmail.com

Type(s)

boolean|integer

If true generate exception when count redirects more than `allowRedirect` value.

throwExceptionOnRedirect : boolean
inherited
var
author

Donii Sergii doniysa@gmail.com

Type(s)

boolean

Clear redirects count.

clearCountRedirects : boolean
inherited
var
author

Donii Sergii doniysa@gmail.com

Type(s)

boolean

Current count redirects.

countRedirects : integer
inherited
var
author

Donii Sergii doniysa@gmail.com

Type(s)

integer

Run migration if true or does not run otherwise.

runMigration : boolean
inherited static
var
author

Donii Sergii doniysa@gmail.com

Type(s)

boolean

Seeds list.

seeds : array
inherited static
var
author

Donii Sergii doniysa@gmail.com

Type(s)

array