<?php include dirname(__FILE__) . '/../../bootstrap/functional.php'; $browser = new sfGuardTestFunctional(new sfBrowser()); $browser->get('/eleccion/index')->isStatusCode(401)->signin()->get('/eleccion/index')->with('request')->begin()->isParameter('module', 'eleccion')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '/Elecciones/')->end();
<?php include dirname(__FILE__) . '/../../bootstrap/functional.php'; $browser = new sfGuardTestFunctional(new sfBrowser()); $browser->get('/lista/index')->isStatusCode(401)->signin()->get('/lista/index')->with('request')->begin()->isParameter('module', 'lista')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();
<?php include dirname(__FILE__) . '/../../bootstrap/functional.php'; $browser = new sfGuardTestFunctional(new sfBrowser()); $browser->get('/politico/index')->isStatusCode(401)->signin()->get('/politico/index')->with('request')->begin()->isParameter('module', 'politico')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end(); $browser->get('/politico/1/edit')->with('request')->begin()->isParameter('module', 'politico')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '/Político/')->end(); $browser->click('Save')->isRedirected()->followRedirect()->with('request')->begin()->isParameter('module', 'politico')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '/The item was updated successfully./')->end();
<?php include dirname(__FILE__) . '/../../bootstrap/functional.php'; $browser = new sfGuardTestFunctional(new sfBrowser()); Doctrine::loadData(sfConfig::get('sf_test_dir') . '/fixtures'); $browser->info('0 - General')->get('/')->with('request')->begin()->isParameter('module', 'list')->isParameter('action', 'index')->end()->with('response')->begin()->checkElement('body', '!/This is a temporary page/')->end(); $browser->info('1 - User owning')->info('1.1 - Not authenticated haven\'t edit link')->get('/')->click('View', array(), array('position' => 1))->with('request')->begin()->isParameter('module', 'list')->isParameter('action', 'show')->end()->with('response')->begin()->isStatusCode(200)->checkElement('a:contains("Edit")', false)->end()->info('1.2 - Authenticated and owner has link to edit')->signinOk(array('username' => 'nacho', 'password' => 'nacho'))->get('/')->click('View', array(), array('position' => 1))->with('request')->begin()->isParameter('module', 'list')->isParameter('action', 'show')->end()->with('response')->begin()->isStatusCode(200)->checkElement('a:contains("Edit")', true)->end()->info('1.3 - Authenticated and owner has link to edit')->click('Edit', array(), array('position' => 1))->with('request')->begin()->isParameter('module', 'list')->isParameter('action', 'edit')->end()->info('1.4 - Authenticated but no owner has not link to edit')->logoutOk()->signinOk(array('username' => 'vito', 'password' => 'vito'))->get('/')->click('View', array(), array('position' => 1))->with('response')->begin()->checkElement('a:contains("Edit")', false)->end();
<?php include dirname(__FILE__) . '/../../bootstrap/functional.php'; $browser = new sfGuardTestFunctional(new sfBrowser()); $browser->get('/sfReview')->isStatusCode(401)->signin()->get('/sfReview')->with('request')->begin()->isParameter('module', 'sfReview')->end()->with('response')->begin()->isStatusCode(200)->checkElement('body', '!/This is a temporary page/')->end();