1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| $browser->
get('/travail/index')->
with('request')->begin()->
isParameter('module', 'travail')->
isParameter('action', 'index')->
end()->
with('response')->begin()->
isStatusCode(200)->
checkElement('h1', '/Travails/')->
end()
;
$browser->info('3. formulaire travail')->
info('3.1 Nouveau travail')->
get('travail/new')->
with('request')->begin()->
isParameter('module', 'travail') ->
isParameter('action', 'new')->
end()->
click('Save', array('travail'=>array(
'batiment' => 'J1',
'etage' => '1',
'bureau' => '125',
'description' => 'Test 1'
)))->
with('request')->begin()->
isParameter('module', 'travail')->
isParameter('action', 'create')->
end()->
with('form')-> hasError(false)->end()->
with('response')->isRedirected()->
followRedirect()->
end()->
with('request')->begin()->
isParameter('module','travail')->
isParameter('action', 'edit')->
end()
;
$browser->info('test Doctrine')->
setTester('doctrine', 'sfTesterDoctrine')->
with('doctrine')->begin()->
check('travail', array(
'batiment' => 'J1',
'etage' => '1',
'description' => 'Test 1',
'statut' => 'init'
))->
end(); |
Partager