I had to change this function to work both on functional test and unit test.
public static function getUser(){
if( ! sfContext::hasInstance() ){
$configuration =
sfApplicationConfiguration::getApplicationConfiguration(
sfConfig::get('sf_app') );
$context =
On Feb 19, 12:08 pm, Nei Rauni Santos nra...@gmail.com wrote:
It worked for me, do you think it's a good solution?
?php
class tools
{
/*
* This code is used to allow get the user object on sf 1.3
* I usually used to $sf_user = sfContext::getInstance()-getUser();
* but it
It worked for me, do you think it's a good solution?
?php
class tools
{
/*
* This code is used to allow get the user object on sf 1.3
* I usually used to $sf_user = sfContext::getInstance()-getUser();
* but it throw exception with the message: The default context does not
exist.
*
This is not a good solution as your libs will be referencing the
context you create, and not the singleton that is running your app. It
may seem to work, since the configuration will be identical - but it's
really not a good solution.
You have 2 options in my opinion.
1. Dirty: Create an