I've finally found a solution:
use the sfModelTestPlugin plug-in
http://trac.symfony-project.com/wiki/sfModelTestPlugin
it's simple... and it works! :)
On 30 avr, 11:17, Grégoire <[EMAIL PROTECTED]> wrote:
> Thank you for your answer.
> Unfortunately, I get the same exception... :/
> [PropelException]
> No connection params set for propel
>
> Here is my modified code :
>
> <?php
>
> /*define('SF_APP', 'frontend');
> define('SF_DEBUG', true);
> define('SF_ENVIRONMENT', 'test');*/
> $app = 'frontend';
>
> //include(dirname(__FILE__).'/../bootstrap/unit.php');
> include(dirname(__FILE__).'/../bootstrap/functional.php');
>
> require_once(SF_ROOT_DIR.'/apps/'.SF_APP.'/config/config.php');
>
> require_once($sf_symfony_lib_dir.'/util/sfCore.class.php');
>
> sfCore::initSimpleAutoload(
> array(
> $sf_symfony_lib_dir,
> SF_ROOT_DIR.'/lib/model',
> SF_ROOT_DIR.'/apps/'.SF_APP.'/lib'
> )
> );
>
> set_include_path($sf_symfony_lib_dir.'/
> vendor'.PATH_SEPARATOR.SF_ROOT_DIR.PATH_SEPARATOR.get_include_path());
>
> $databaseManager = new sfDatabaseManager();
> $databaseManager->initialize();
>
> // Initialize the test object
> $t = new lime_test(1, new lime_output_color());
>
> On 30 avr, 11:08, "Nicolas Perriault" <[EMAIL PROTECTED]> wrote:
>
> > On Wed, Apr 30, 2008 at 10:56 AM, Grégoire <[EMAIL PROTECTED]> wrote:
> > > I'm trying to accessing to my database in a unit test. I use Lime for
> > > those tests. I have the following exception when I execute my test :
>
> > You can use the functional bootstrap:
>
> > <?php
> > $app = 'frontend'; // <-- Your tested app name goes here
> > $sf_root = dirname(__FILE__).'/../..';
> > require_once($sf_root.'/lib/symfony/vendor/lime/lime.php');
> > include($sf_root.'/test/bootstrap/functional.php');
>
> > $databaseManager = new sfDatabaseManager();
> > $databaseManager->initialize();
> > ...
>
> > HTH
>
> > ++
>
> > --
> > Nicolas Perriaulthttp://prendreuncafe.com/blog
> > GSM: 06.60.92.08.67
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---