Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/*
4
 * This file is part of the symfony package.
5
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
 
11
// we need SQLite for functional tests
12
if (!extension_loaded('SQLite') && !extension_loaded('pdo_SQLite'))
13
{
14
  return false;
15
}
16
 
17
if (!isset($root_dir))
18
{
19
  $root_dir = realpath(dirname(__FILE__).sprintf('/../%s/fixtures', isset($type) ? $type : 'functional'));
20
}
21
 
22
require_once $root_dir.'/config/ProjectConfiguration.class.php';
23
$configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
24
sfContext::createInstance($configuration);
25
 
26
// remove all cache
27
sf_functional_test_shutdown();
28
register_shutdown_function('sf_functional_test_shutdown');
29
 
30
$configuration->initializePropel($app);
31
if (isset($fixtures))
32
{
33
  $configuration->loadFixtures($fixtures);
34
}
35
 
36
function sf_functional_test_shutdown_cleanup()
37
{
38
  sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir'));
39
  sfToolkit::clearDirectory(sfConfig::get('sf_log_dir'));
40
}
41
 
42
function sf_functional_test_shutdown()
43
{
44
  // try/catch needed due to http://bugs.php.net/bug.php?id=33598
45
  try
46
  {
47
    sf_functional_test_shutdown_cleanup();
48
  }
49
  catch (Exception $e)
50
  {
51
    echo $e.PHP_EOL;
52
  }
53
}
54
 
55
return true;