<?php

// Autofind the first available app environment
$sf_root_dir = realpath(dirname(__FILE__).'/../../../');
$apps_dir = glob($sf_root_dir.'/apps/*', GLOB_ONLYDIR);
$app = substr($apps_dir[0], 
              strrpos($apps_dir[0], DIRECTORY_SEPARATOR) + 1, 
              strlen($apps_dir[0]));
if (!$app)
{
  throw new Exception('No app has been detected in this project');
}

// -- path to the symfony project where the plugin resides
$sf_path = dirname(__FILE__).'/../../..';
 
// bootstrap
include($sf_path . '/test/bootstrap/functional.php');

// create a new test browser
$browser = new sfTestBrowser();
$browser->initialize();

// initialize database manager
if(method_exists('sfDatabaseManager', 'loadConfiguration'))
{
  // symfony 1.1 style
  new sfDatabaseManager($configuration);
}
else
{
  // symfony 1.0 style
  $databaseManager = new sfDatabaseManager();
  $databaseManager->initialize();
}

<?php

// Autofind the first available app environment
$sf_root_dir = realpath(dirname(__FILE__).'/../../../');
$apps_dir = glob($sf_root_dir.'/apps/*', GLOB_ONLYDIR);
$app = substr($apps_dir[0], 
              strrpos($apps_dir[0], DIRECTORY_SEPARATOR) + 1, 
              strlen($apps_dir[0]));
if (!$app)
{
  throw new Exception('No app has been detected in this project');
}

// -- path to the symfony project where the plugin resides
$sf_path = dirname(__FILE__).'/../../..';
 
// bootstrap
include($sf_path . '/test/bootstrap/functional.php');

// create a new test browser
$browser = new sfTestBrowser();
$browser->initialize();

// initialize database manager
$databaseManager = new sfDatabaseManager();
$databaseManager->initialize();
--- 
+++ 
@@ -22,5 +22,14 @@
 $browser->initialize();
 
 // initialize database manager
-$databaseManager = new sfDatabaseManager();
-$databaseManager->initialize();
+if(method_exists('sfDatabaseManager', 'loadConfiguration'))
+{
+  // symfony 1.1 style
+  new sfDatabaseManager($configuration);
+}
+else
+{
+  // symfony 1.0 style
+  $databaseManager = new sfDatabaseManager();
+  $databaseManager->initialize();
+}
[wiki:DbFinderPlugin] Allow for easier testing with sf 1.1

git-svn-id: 1cdbda4e123179f2e1e2c55188bc07ae93e59a0a@13191 ee427ae8-e902-0410-961c-c3ed070cd9f9
