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
include(dirname(__FILE__).'/../bootstrap/unit.php');
12
 
13
$t = new lime_test(4);
14
 
15
class ProjectConfiguration extends sfProjectConfiguration
16
{
17
}
18
 
19
$configuration = new ProjectConfiguration(dirname(__FILE__).'/../../lib', new sfEventDispatcher());
20
 
21
$parameters = array(
22
  'name'        => 'doctrine',
23
  'dsn'         => 'sqlite::memory',
24
  'attributes'  => array(
25
    'use_native_enum'   => true,
26
    'validate'          => 'all',
27
    'tblname_format'    => 'test_%s',
28
  ),
29
);
30
 
31
$p = new sfDoctrineDatabase($parameters);
32
$t->is($p->getDoctrineConnection()->getName(), 'doctrine', 'initialize() - creates a valid doctrine configuration from parameters');
33
$t->is($p->getDoctrineConnection()->getAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM), true, 'initialize() - setups doctrine attributes - attribute value is not a string');
34
$t->is($p->getDoctrineConnection()->getAttribute(Doctrine_Core::ATTR_VALIDATE), Doctrine_Core::VALIDATE_ALL, 'initialize() - setups doctrine attributes - attribute value is a string and constant exists');
35
$t->is($p->getDoctrineConnection()->getAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT), $parameters['attributes']['tblname_format'], 'initialize() - setups doctrine attributes - attribute value is a string and constant not exists');
36
 
37