TYPO3\Surf\Task\Test\HttpTestTask

class HttpTestTask

A task for testing HTTP request

This task could be used to do smoke-tests against web applications in release (e.g. on a virtual host mounted on the “next” symlink).

property shell

protected ShellCommandService

__construct(ClientInterface $client = null)

HttpTestTask constructor.

Parameters:
  • $client (ClientInterface) –
setClient(ClientInterface $client)
Parameters:
  • $client (ClientInterface) –
execute(Node $node, Application $application, Deployment $deployment, $options = [])

Execute this task

Parameters:
resolveOptions(OptionsResolver $resolver)
Parameters:
  • $resolver (OptionsResolver) –
assertExpectedStatus($expected, $actual)
Parameters:
  • $expected (int) –
  • $actual (int) –
assertExpectedHeaders($expected, $actual)
Parameters:
  • $expected (array) –
  • $actual (array) –
assertExpectedRegexp($expectedRegexp, $responseBody)
Parameters:
  • $expectedRegexp (array) –
  • $responseBody (string) –
testSingleHeader($headerValue, $expectedValue)

Compare returned HTTP headers with expected values

Parameters:
  • $headerValue (string) –
  • $expectedValue (string) –
Returns:

bool

executeLocalCurlRequest($url, $options = [])
Parameters:
  • $url (string) – Request URL
  • $options (array) –
Returns:

HttpResponse

executeRemoteCurlRequest($url, Node $node, Deployment $deployment, $additionalCurlParameters = '')
Parameters:
  • $url (string) – Request URL
  • $node (Node) –
  • $deployment (Deployment) –
  • $additionalCurlParameters (string) –
Returns:

HttpResponse

extractHeadersFromMultiLineString($headerText)

Split response into headers and body part

Parameters:
  • $headerText (string) –
Returns:

array Extracted response headers as associative array

setShellCommandService(ShellCommandService $shellCommandService)
Parameters:
rollback(Node $node, Application $application, Deployment $deployment, $options = [])

Rollback this task

Parameters:
simulate(Node $node, Application $application, Deployment $deployment, $options = [])

Simulate this task (e.g. by logging commands it would execute)

Parameters:
configureOptions($options = [])
Parameters:
  • $options (array) –
Returns:

array