Merge pull request #3599 from kinglozzer/numericfield-whitespace

Fix whitespace issues in NumericField/NumericFieldTest
This commit is contained in:
Damian Mooyman 2014-11-14 10:31:21 +13:00
commit 7f2161d7a0
2 changed files with 18 additions and 18 deletions

View File

@ -46,25 +46,24 @@ class NumericField extends TextField {
}
/**
* Returns a readonly version of this field
*/
public function performReadonlyTransformation() {
$field = new NumericField_Readonly($this->name, $this->title, $this->value);
$field->setForm($this->form);
return $field;
}
* Returns a readonly version of this field
*/
public function performReadonlyTransformation() {
$field = new NumericField_Readonly($this->name, $this->title, $this->value);
$field->setForm($this->form);
return $field;
}
}
class NumericField_Readonly extends ReadonlyField{
class NumericField_Readonly extends ReadonlyField {
public function performReadonlyTransformation() {
return clone $this;
}
public function performReadonlyTransformation() {
return clone $this;
}
public function Value() {
return Convert::raw2xml($this->value ?
"$this->value" : "0");
}
public function Value() {
return Convert::raw2xml($this->value ? "$this->value" : "0");
}
}
}

View File

@ -37,4 +37,5 @@ class NumericFieldTest extends SapphireTest {
$field->setValue(0);
$this->assertRegExp("#<span[^>]+>\s*0\s*<\/span>#", "".$field->performReadonlyTransformation()->Field()."");
}
}
}