Ejemplo n.º 1
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new mrTestFunctional(new sfBrowser());
$browser->login()->get('/games')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Gears of War/')->end()->click('Add Game')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_game' => array('name' => 'Gears of War', 'medium' => 'Disc', 'year' => '2006', 'platform' => 'Xbox 360')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/Gears of War/')->end()->get('/games')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/Gears of War/')->end()->with('doctrine')->begin()->check('mrGame', array('name' => 'Gears of War', 'status' => 'owned'))->end()->get('/games/wishlist')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Halo 3/')->matches('!/Gears of War/')->end()->click('Add Game')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_game' => array('name' => 'Halo 3', 'medium' => 'Disc', 'year' => '2007', 'platform' => 'Xbox 360')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/Halo 3/')->end()->get('/games/wishlist')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/Halo 3/')->matches('!/Gears of War/')->end()->with('doctrine')->begin()->check('mrGame', array('name' => 'Halo 3', 'status' => 'wishlist'))->end()->get('/games')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Halo 3/')->matches('/Gears of War/')->end();
Ejemplo n.º 2
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new mrTestFunctional(new sfBrowser());
$browser->login()->get('/books')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/A Game of Thrones/')->end()->click('Add Book')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_book' => array('name' => 'A Game of Thrones', 'medium' => 'Hardback', 'year' => '1997', 'author' => 'George R.R. Martin')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/A Game of Thrones/')->end()->get('/books')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/A Game of Thrones/')->end()->with('doctrine')->begin()->check('mrBook', array('name' => 'A Game of Thrones', 'status' => 'owned'))->end()->get('/books/wishlist')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/A Storm of Swords/')->matches('!/A Game of Thrones/')->end()->click('Add Book')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_book' => array('name' => 'A Storm of Swords', 'medium' => 'Hardback', 'year' => '2003', 'author' => 'George R.R. Martin')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/A Storm of Swords/')->end()->get('/books/wishlist')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/A Storm of Swords/')->matches('!/A Game of Thrones/')->end()->with('doctrine')->begin()->check('mrBook', array('name' => 'A Storm of Swords', 'status' => 'wishlist'))->end()->get('/books')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/A Storm of Swords/')->matches('/A Game of Thrones/')->end();
Ejemplo n.º 3
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new mrTestFunctional(new sfBrowser());
$browser->login()->get('/movies')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Pretty Woman/')->end()->click('Add Movie')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_movie' => array('name' => 'Pretty Woman', 'medium' => 'DVD', 'year' => '1990', 'format' => '16:9')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/Pretty Woman/')->end()->get('/movies')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/Pretty Woman/')->end()->with('doctrine')->begin()->check('mrMovie', array('name' => 'Pretty Woman', 'status' => 'owned'))->end()->get('/movies/wishlist')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/King Kong/')->matches('!/Pretty Woman/')->end()->click('Add Movie')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_movie' => array('name' => 'King Kong', 'medium' => 'DVD', 'year' => '2006', 'format' => '16:9')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/King Kong/')->end()->get('/movies/wishlist')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/King Kong/')->matches('!/Pretty Woman/')->end()->with('doctrine')->begin()->check('mrMovie', array('name' => 'King Kong', 'status' => 'wishlist'))->end()->get('/movies')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/King Kong/')->matches('/Pretty Woman/')->end();
Ejemplo n.º 4
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new mrTestFunctional(new sfBrowser());
$browser->get('/account')->with('request')->begin()->isParameter('module', 'account')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->get('/books')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->get('/games')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->get('/movies')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->get('/music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->get('/register')->with('request')->begin()->isParameter('module', 'account')->isParameter('action', 'register')->end()->with('response')->begin()->isStatusCode(200)->matches('/Username/')->matches('/Password/')->matches('/Password again/')->end()->click('Submit', array('sf_guard_user' => array('username' => 'functional', 'password' => 'functional', 'password_again' => 'functional')))->with('form')->begin()->hasErrors(0)->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'sfGuardAuth')->isParameter('action', 'signin')->end()->login('functional', 'functional')->with('request')->begin()->isParameter('module', 'account')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->get('/books')->with('request')->begin()->isParameter('module', 'mrBook')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->get('/games')->with('request')->begin()->isParameter('module', 'mrGame')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->get('/movies')->with('request')->begin()->isParameter('module', 'mrMovie')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->get('/music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->end()->get('/register')->with('request')->begin()->isParameter('module', 'account')->isParameter('action', 'register')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'account')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/functional/')->end();
Ejemplo n.º 5
0
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new mrTestFunctional(new sfBrowser());
$browser->login()->get('/music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/In the Aeroplane Over the Sea/')->end()->click('Add Music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_music' => array('name' => 'In the Aeroplane Over the Sea', 'medium' => 'CD', 'year' => '1998', 'artist' => 'Neutral Milk Hotel')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/In the Aeroplane Over the Sea/')->end()->get('/music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/In the Aeroplane Over the Sea/')->end()->with('doctrine')->begin()->check('mrMusic', array('name' => 'In the Aeroplane Over the Sea', 'status' => 'owned'))->end()->get('/music/wishlist')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Fang Island/')->matches('!/In the Aeroplane Over the Sea/')->end()->click('Add Music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'new')->end()->with('response')->begin()->isStatusCode(200)->end()->click('Save', array('mr_music' => array('name' => 'Fang Island', 'medium' => 'Digital', 'year' => '2010', 'artist' => 'Fang Island')))->with('form')->begin()->hasErrors(0)->end()->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'create')->end()->with('response')->begin()->isStatusCode(302)->isRedirected()->followRedirect()->end()->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'edit')->end()->with('response')->begin()->isStatusCode(200)->matches('/Fang Island/')->end()->get('/music/wishlist')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('/Fang Island/')->matches('!/In the Aeroplane Over the Sea/')->end()->with('doctrine')->begin()->check('mrMusic', array('name' => 'Fang Island', 'status' => 'wishlist'))->end()->get('/music')->with('request')->begin()->isParameter('module', 'mrMusic')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(200)->matches('!/Fang Island/')->matches('/In the Aeroplane Over the Sea/')->end();