User Tools

Site Tools


php:testersreqres

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

php:testersreqres [2013/03/16 17:40]
php:testersreqres [2013/03/16 17:40] (current)
Line 1: Line 1:
 +==== 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.
 +
 +<​code>​
 +$browser
 +    ->​get('/​foo/​bar'​)
 +    ->​with('​request'​)->​begin()->​
 +            ... sfTesterRequest methods...
 +    end();
 +</​code>​
 +
 +
 +=== 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.
 +
 +
 +<​code>​
 +$browser
 +    ->​get('/​foo/​bar'​)
 +    ->​with('​response'​)->​begin()
 +           ... sfTesterResponse methods...
 +    ->end()
 +</​code>​
 +
  
php/testersreqres.txt ยท Last modified: 2013/03/16 17:40 (external edit)