Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?php // lib/sfBackendTestFunctional.class.php /** * This class is used to run functional tests in a secured backend * * Takes care of the login action, and the fixtures loading */ class sfBackendTestFunctional extends sfTestFunctional { public function __construct($browser, $lime = null, $testers = array()) { parent::__construct($browser, $lime, $testers); } /** * Perform user authentication * * @param array of String $user_data * @return sfGuardTestFunctional $this */ public function signin($user_data) { return $this->info(sprintf('Login as "%s"', $user_data['username']))-> get('/login')-> click('sign in', array('signin' => $user_data), array('_with_csrf' => true))-> with('form')->begin()-> hasErrors(false)-> end()-> with('user')->begin()-> isAuthenticated(true)-> end()-> with('request')->begin()-> isParameter('module', 'sfGuardAuth')-> isParameter('action', 'signin')-> end()-> with('response')->begin()-> isRedirected()-> followRedirect()-> end() ; } /** * Load project fixtures **/ public function loadData() { Doctrine::loadData(sfConfig::get('sf_data_dir').'/fixtures'); return $this; } }
This paste will be private.
From the Design Piracy series on my blog: