Beispiel #1
0
 protected function configure()
 {
     fORMValidation::addStringReplacement($this, 'Login Name: The value specified must be unique, however it already exists', '不能重复创建个人信息');
     fORMValidation::addStringReplacement($this, 'Start Year: Please enter a value', '请选择入学年份');
     fORMValidation::addStringReplacement($this, 'Birthday: Please enter a value', '请选择生日');
     fORMValidation::addStringReplacement($this, 'Gender: Please enter a value', '请选择性别');
     fORMValidation::addStringReplacement($this, 'Location: Please enter a value', '请填写现居住地');
     fORMValidation::addStringReplacement($this, 'Hometown: Please enter a value', '请填写家乡');
     fORMValidation::addStringReplacement($this, 'High School: Please enter a value', '请填写高中名称');
 }
 public function testReplaceWithChildren()
 {
     try {
         fORMOrdering::configureOrderingColumn('FavoriteAlbum', 'position');
         fORMValidation::addRegexReplacement('User', '#(First|Last) Name#', 'Name');
         fORMValidation::addStringReplacement('User', 'Email Address', 'Email');
         $user = $this->createUser();
         $user->setFirstName(NULL);
         $user->setEmailAddress(NULL);
         $favorite_album_1 = new FavoriteAlbum();
         $favorite_album_2 = new FavoriteAlbum();
         $user->associateFavoriteAlbums(array($favorite_album_1, $favorite_album_2));
         $user->validate();
     } catch (fValidationException $e) {
         $message = preg_replace('#\\s+#', ' ', strip_tags($e->getMessage()));
         $this->assertContains('The following problems were found: Name: Please enter a value Email: Please enter a value', $message);
         $this->assertContains('Favorite Album #1 Album ID: Please enter a value', $message);
         $this->assertContains('Favorite Album #2 Album ID: Please enter a value', $message);
     }
 }
Beispiel #3
0
 protected function configure()
 {
     fORMValidation::addStringReplacement($this, 'Type: Please enter a value', '请选择类型');
     fORMValidation::addStringReplacement($this, 'Major: Please enter a value', '请输入专业/方向');
     fORMValidation::addStringReplacement($this, 'Location: Please enter a value', '请输入学校/单位');
 }
Beispiel #4
0
 protected function configure()
 {
     fORMValidation::addStringReplacement($this, 'Title: Please enter a value', '请输入标题');
     fORMValidation::addStringReplacement($this, 'Content: Please enter a value', '请输入文章内容');
 }
Beispiel #5
0
 protected function configure()
 {
     fORMValidation::addStringReplacement($this, 'Description: Please enter a value', '请填写荣誉描述');
 }
Beispiel #6
0
 protected function configure()
 {
     fORMValidation::addStringReplacement($this, 'Title: Please enter a value', '请填写标题');
     fORMValidation::addStringReplacement($this, 'Authors: Please enter a value', '请填写作者列表');
     fORMValidation::addStringReplacement($this, 'Publish Place: Please enter a value', '请填写论文发表在哪里');
 }