<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DoctrineTestFunctional(new sfBrowser());
$browser->loadData()->restart();
$browser->info('1. Mobile Player - this page should be secure')->get('/player/mobile')->with('request')->begin()->isParameter('module', 'player_mobile')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end()->info('2. Mobile Player - login and test partials')->authenticate()->get('/player/mobile')->with('request')->begin()->isParameter('module', 'player_mobile')->isParameter('action', 'index')->end()->with('response')->begin()->info('2.1 Validating response')->isStatusCode(200)->info('2.2 Validating partials')->checkElement('#container')->checkElement('#songlist')->checkElement('#artistlistcontainer')->checkElement('#albumlistcontainer')->checkElement('#musicplayer')->checkElement('#settingscontainer')->checkElement('#playlistlistcontainer')->checkElement('#loadjavascript')->checkElement('#welcomescreen')->checkElement('#header')->checkElement('#genrelistcontainer')->end()->info('3. Mobile Player - testing logout button')->click('#logout')->with('request')->begin()->isParameter('module', 'player')->isParameter('action', 'index')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DoctrineTestFunctional(new sfBrowser());
$browser->loadData()->restart();
$browser->info('1. Internal services should be secure')->get('/service/listAlbums')->with('request')->begin()->isParameter('module', 'service')->isParameter('action', 'listAlbums')->end()->with('response')->begin()->isStatusCode(401)->end()->info('2. Login and Get a list of Albums')->authenticate()->get('/service/listAlbums')->with('response')->begin()->isStatusCode(200)->matches('/\\"id\\"\\:1/')->matches('/\\"id\\"\\:2/')->end()->info('3. Get list by artist id')->get('/service/listAlbums', array('artist_id' => '1'))->with('response')->begin()->isStatusCode(200)->matches('/\\"id\\"\\:1/')->end()->info('4. Get list by alphabetical character')->get('/service/listAlbums', array('alpha' => 't'))->with('response')->begin()->isStatusCode(200)->matches('/\\"id\\"\\:2/')->end()->info('5. Get list by alphabetical character and artist id')->get('/service/listAlbums', array('artist_id' => '2', 'alpha' => 't'))->with('response')->begin()->isStatusCode(200)->matches('/\\"id\\"\\:2/')->end();
<?php

include dirname(__FILE__) . '/../../bootstrap/functional.php';
$browser = new DoctrineTestFunctional(new sfBrowser());
$browser->loadData()->restart();
$browser->info('1. PLayer Selector - this page should be secure')->get('/player')->with('request')->begin()->isParameter('module', 'player')->isParameter('action', 'index')->end()->with('response')->begin()->isStatusCode(401)->end();
$browser->info('2. Player Selector - login and test partials')->authenticate()->get('/player')->with('request')->begin()->isParameter('module', 'player')->isParameter('action', 'index')->end()->with('response')->begin()->info('2.1 Validating response')->isStatusCode(200)->info('2.2 Validating partials')->checkElement('#button_text')->end()->info('3. Test the click paths')->click('#desktop')->with('request')->begin()->isParameter('module', 'player_desktop')->isParameter('action', 'index')->end()->back()->click('#mobile')->with('request')->begin()->isParameter('module', 'player_mobile')->isParameter('action', 'index')->end()->back()->click('#logout')->with('request')->begin()->isParameter('module', 'sfGuardAuth')->isParameter('action', 'signout')->end();