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
require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
12
 
13
$t = new lime_test(1);
14
 
15
class ProjectConfiguration extends sfProjectConfiguration
16
{
17
  protected $plugins = array('sfPropelPlugin');
18
}
19
new ProjectConfiguration();
20
 
21
// ->__construct()
22
$t->diag('->__construct()');
23
 
24
$configuration = array(
25
  'propel' => array(
26
    'datasources' => array(
27
      'propel' => array(
28
        'adapter' => 'mysql',
29
        'connection' => array(
30
          'dsn' => 'mysql:dbname=testdb;host=localhost',
31
          'user' => 'foo',
32
          'password' => 'bar',
33
          'classname' => 'PropelPDO',
34
          'options' => array(
35
            'ATTR_PERSISTENT' => true,
36
            'ATTR_AUTOCOMMIT' => false,
37
          ),
38
          'settings' => array(
39
            'charset' => array('value' => 'utf8'),
40
            'queries' => array(),
41
          ),
42
        ),
43
      ),
44
      'default' => 'propel',
45
    ),
46
  ),
47
);
48
 
49
$parametersTests = array(
50
  'dsn'        => 'mysql:dbname=testdb;host=localhost',
51
  'username'   => 'foo',
52
  'password'   => 'bar',
53
  'encoding'   => 'utf8',
54
  'persistent' => true,
55
  'options'    => array('ATTR_AUTOCOMMIT' => false)
56
);
57
 
58
$p = new sfPropelDatabase($parametersTests);
59
$t->is_deeply($p->getConfiguration(), $configuration, '->__construct() creates a valid propel configuration from parameters');