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(2);
15
 
16
$data = array(
17
  'unique_test1' => 'test',
18
  'unique_test2' => 'test',
19
  'unique_test3' => 'test',
20
  'unique_test4' => 'test'
21
);
22
 
23
$uniqueTestForm = new UniqueTestForm();
24
$uniqueTestForm->bind($data);
25
$uniqueTestForm->save();
26
 
27
$uniqueTestForm = new UniqueTestForm();
28
$uniqueTestForm->bind($data);
29
$t->is($uniqueTestForm->isValid(), false);
30
$t->is((string) $uniqueTestForm->getErrorSchema(), 'unique_test1 [An object with the same "unique_test1" already exist. An object with the same "unique_test1, unique_test2" already exist.] unique_test4 [An object with the same "unique_test4" already exist.]');