mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #3599 from kinglozzer/numericfield-whitespace
Fix whitespace issues in NumericField/NumericFieldTest
This commit is contained in:
commit
7f2161d7a0
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,5 @@ class NumericFieldTest extends SapphireTest {
|
||||
$field->setValue(0);
|
||||
$this->assertRegExp("#<span[^>]+>\s*0\s*<\/span>#", "".$field->performReadonlyTransformation()->Field()."");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user