|
@@ 23-33 (lines=11) @@
|
| 20 |
|
Article::class, |
| 21 |
|
); |
| 22 |
|
|
| 23 |
|
public function testFieldValueTrue() |
| 24 |
|
{ |
| 25 |
|
/* Create the field, and set the value as boolean true */ |
| 26 |
|
$field = new CheckboxField('IsChecked', 'Checked'); |
| 27 |
|
$field->setValue(true); |
| 28 |
|
|
| 29 |
|
/* dataValue() for the field is 1 */ |
| 30 |
|
$this->assertEquals($field->dataValue(), 1, 'dataValue() returns a 1'); |
| 31 |
|
|
| 32 |
|
/* Value() returns 1 as well */ |
| 33 |
|
$this->assertEquals($field->Value(), 1, 'Value() returns a 1'); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
public function testFieldValueString() |
|
@@ 36-46 (lines=11) @@
|
| 33 |
|
$this->assertEquals($field->Value(), 1, 'Value() returns a 1'); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
public function testFieldValueString() |
| 37 |
|
{ |
| 38 |
|
/* Create the field, and set the value as "on" (raw request field value from DOM) */ |
| 39 |
|
$field = new CheckboxField('IsChecked', 'Checked'); |
| 40 |
|
$field->setValue('on'); |
| 41 |
|
|
| 42 |
|
/* dataValue() for the field is 1 */ |
| 43 |
|
$this->assertEquals($field->dataValue(), 1, 'dataValue() returns a 1'); |
| 44 |
|
|
| 45 |
|
/* Value() returns 1 as well */ |
| 46 |
|
$this->assertEquals($field->Value(), 1, 'Value() returns a 1'); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testFieldValueSettingNull() |
|
@@ 49-59 (lines=11) @@
|
| 46 |
|
$this->assertEquals($field->Value(), 1, 'Value() returns a 1'); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
public function testFieldValueSettingNull() |
| 50 |
|
{ |
| 51 |
|
/* Create the field, and set the value as NULL */ |
| 52 |
|
$field = new CheckboxField('IsChecked', 'Checked'); |
| 53 |
|
$field->setValue(null); |
| 54 |
|
|
| 55 |
|
/* dataValue() for the field is null */ |
| 56 |
|
$this->assertEquals($field->dataValue(), null, 'dataValue() returns a 0'); |
| 57 |
|
|
| 58 |
|
/* Value() returns 0 as well */ |
| 59 |
|
$this->assertEquals($field->Value(), 0, 'Value() returns a 0'); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function testFieldValueSettingFalse() |
|
@@ 62-72 (lines=11) @@
|
| 59 |
|
$this->assertEquals($field->Value(), 0, 'Value() returns a 0'); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function testFieldValueSettingFalse() |
| 63 |
|
{ |
| 64 |
|
/* Create the field, and set the value as NULL */ |
| 65 |
|
$field = new CheckboxField('IsChecked', 'Checked'); |
| 66 |
|
$field->setValue(false); |
| 67 |
|
|
| 68 |
|
/* dataValue() for the field is null */ |
| 69 |
|
$this->assertEquals($field->dataValue(), null, 'dataValue() returns a 0'); |
| 70 |
|
|
| 71 |
|
/* Value() returns 0 as well */ |
| 72 |
|
$this->assertEquals($field->Value(), 0, 'Value() returns a 0'); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testFieldValueWithoutSettingValue() |