User Tools

Site Tools


php:testersreqres

Methods list for response and request tester in functional tests

03.02.2010

for Symfony 1.4

sfTesterRequest

  • public function prepare() - prepares the tester
  • public function initialize() - Initializes the tester
  • public function isParameter($key, $value) - Tests whether or not a given key and value exists in the request.
  • public function isFormat($format) - Tests for the request is in the given format.
  • public function isMethod($method) - Tests if the current HTTP method matches the given one
  • public function hasCookie($name, $exists = true) - Checks if a cookie exists.
  • public function isCookie($name, $value) - Checks the value of a cookie.

$browser
    ->get('/foo/bar')
    ->with('request')->begin()->
            ... sfTesterRequest methods...
    end();

sfTesterResponse

  • public function prepare() - prepares the tester
  • public function initialize() - Initializes the tester
  • public function checkElement($selector, $value = true, $options = array()) - Tests that the response matches a given CSS selector.
  • public function checkForm($form, $selector = 'form') - Checks that a form is rendered correctly.
  • public function isValid($checkDTD = false) - Validates the response.
  • public function isHeader($key, $value) - Tests for a response header.
  • public function setsCookie($name, $value = null, $attributes = array()) - Tests if a cookie was set.
  • public function matches($regex) - Tests the response content against a regex.
  • public function isStatusCode($statusCode = 200) - Tests the status code.
  • public function isRedirected($boolean = true) - Tests if the current request has been redirected.
  • public function debug($realOutput = false) - Outputs some debug information about the current response.

$browser
    ->get('/foo/bar')
    ->with('response')->begin()
           ... sfTesterResponse methods...
    ->end()

php/testersreqres.txt · Last modified: 2013/03/16 17:40 (external edit)