2 // vim: foldmethod=marker
4 * Ethna_ActionForm_Validator_Mbstrmax_Test.php
6 * @author Yoshinari Takaoka <takaoka@beatcraft.com>
10 // {{{ Ethna_ActionForm_Validator_Mbstrmax_Test
12 * Test Case For Ethna_ActionForm(Max Validator(Multibyte String))
16 class Ethna_ActionForm_Validator_Mbstrmax_Test extends Ethna_UnitTestBase
20 $this->af->use_validator_plugin = false;
21 $this->af->clearFormVars();
22 $this->af->form = array();
26 // {{{ Validator Max Multibyte String.
27 function test_Validate_MbMax_String()
30 'type' => VAR_TYPE_STRING,
31 'form_type' => FORM_TYPE_TEXT,
35 $this->af->setDef('input', $form_def);
38 $this->af->set('input', 'abc');
39 $this->af->validate();
40 $this->assertFalse($this->ae->isError('input'));
43 $this->af->set('input', 'abcd');
44 $this->af->validate();
45 $this->assertTrue($this->ae->isError('input'));
48 $this->af->set('input', 'ab');
49 $this->af->validate();
50 $this->assertFalse($this->ae->isError('input'));
54 $this->af->set('input', 'あいう');
55 $this->af->validate();
56 $this->assertFalse($this->ae->isError('input'));
59 $this->af->set('input', 'あいうえ');
60 $this->af->validate();
61 $this->assertTrue($this->ae->isError('input'));
64 $this->af->set('input', 'あい');
65 $this->af->validate();
66 $this->assertFalse($this->ae->isError('input'));
68 // TODO: Error Message Test.