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
$app = 'frontend';
12
require_once(dirname(__FILE__).'/../../bootstrap/functional.php');
13
 
14
$t = new lime_test(1);
15
 
16
class TestUserForm extends UserForm
17
{
18
  public function configure()
19
  {
20
    parent::configure();
21
    unset($this['test']);
22
  }
23
}
24
 
25
$user = new User();
26
$user->username = 'nullvaluetest';
27
$user->password = 'changeme';
28
$user->test = 'test';
29
$user->save();
30
$user->free();
31
unset($user);
32
 
33
$user = Doctrine_Core::getTable('User')->findOneByUsername('nullvaluetest');
34
$userForm = new TestUserForm($user);
35
$userForm->bind(array('id' => $user->id, 'username' => 'nullvaluetest', 'password' => 'changeme2'));
36
if ($userForm->isValid())
37
{
38
  $userForm->save();
39
}
40
 
41
$user->free();
42
unset($user);
43
 
44
$user = Doctrine_Core::getTable('User')->findOneByUsername('nullvaluetest');
45
$t->is($user->toArray(), array('id' => 1, 'username' => 'nullvaluetest', 'password' => 'b0660f0b8b989971524762330aea5449', 'test' => 'test'));