Module for symfony 1.x framework
Codeception Module that interacts with Symfony 1.4 applications., (*1)
Replaces functional testing framework from symfony. Authorization features uses Doctrine and sfDoctrineGuardPlugin. Uses native symfony connections and test classes. Provides additional informations on every actions., (*2)
If test fails stores last shown page in 'log' dir., (*3)
In composer.json
, (*4)
"require-dev": { "codeception/codeception": "~2.1", "codeception/symfony1module": "*" }
Log in as sfDoctrineGuardUser. Only name of user should be provided. Fetches user by it's username from sfGuardUser table., (*5)
param
$name
\ExceptionOpens the page., (*6)
param
$pageClick on link or button and move to next page. Either link text, css selector, or xpath can be passed, (*7)
param
$linkEmulates click on form's submit button. You don't need that action if you fill form by ->submitForm action., (*8)
param
$selectorCheck if current page doesn't contain the text specified. Specify the css selector to match only specific region., (*9)
Examples:, (*10)
<?php $I->dontSee('Login'); // I can suppose user is already logged in $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
param
$textparam null
$selectorAssert if the specified checkbox is unchecked. Use css selector or xpath to match., (*11)
Example:, (*12)
``` php <?php $I->dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form., (*13)
* `param` $selector ### dontSeeLink Checks if page doesn't contain the link with text specified. Specify url to narrow the results. Examples: ``` php <?php $I->dontSeeLink('Logout'); // I suppose user is not logged in
param
$textparam null
$urlCheck if current page contains the text specified. Specify the css selector to match only specific region., (*14)
Examples:, (*15)
``` php <?php $I->see('Logout'); // I can suppose user is logged in $I->see('Sign Up','h1'); // I can suppose it's a signup page, (*16)
* `param` $text * `param null` $selector ### seeCheckboxIsChecked Assert if the specified checkbox is checked. Use css selector or xpath to match. Example: ``` php <?php $I->seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
param
$selectorChecks if there were at least one email sent through Symfony test mailer., (*17)
Checks for invalid value in Symfony1 form. Matches the first sfForm instance from controller and returns getErrorSchema() values. Specify field which should contain error message., (*18)
param
$fieldPerforms validation of Symfony1 form. Matches the first sfForm instance from controller and returns getErrorSchema() values. Shows all errors in debug., (*19)
Performs validation of Symfony1 form. Matches the first sfForm instance from controller and returns isValid() value., (*20)
Checks if there is a link with text specified. Specify url to match link with exact this url., (*21)
Examples:, (*22)
``` php <?php $I->seeLink('Logout'); // matches Logout $I->seeLink('Logout','/logout'); // matches Logout, (*23)
* `param` $text * `param null` $url ### sendAjaxGetRequest If your page triggers an ajax request, you can perform it manually. This action sends a GET ajax request with specified params. See ->sendAjaxPostRequest for examples. * `param` $uri * `param` $params ### sendAjaxPostRequest If your page triggers an ajax request, you can perform it manually. This action sends a POST ajax request with specified params. Additional params can be passed as array. Example: Imagine that by clicking checkbox you trigger ajax request which updates user settings. We emulate that click by running this ajax request manually. ``` php <?php $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true); // POST $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true); // GET
param
$uriparam
$paramsSign's user in with sfGuardAuth. Uses standard path: /sfGuardAuth/signin for authorization. Provide username and password., (*24)
param
$usernameparam
$passwordSign out is performing by triggering '/logout' url., (*25)
Submits a form located on page. Specify the form by it's css or xpath selector. Fill the form fields values as array., (*26)
Skipped fields will be filled by their values from page. You don't need to click the 'Submit' button afterwards. This command itself triggers the request to form's action., (*27)
Examples:, (*28)
``` php <?php $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));, (*29)
For sample Sign Up form: ``` html <form action="/sign_up"> Login: <input type="text" name="user[login]" /><br/> Password: <input type="password" name="user[password]" /><br/> Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/> Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select> <input type="submit" value="Submit" /> </form>
I can write this:, (*30)
``` php <?php $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));, (*31)
``` Note, that pricing plan will be set to Paid, as it's selected on page., (*32)
param
$selectorparam
$params