diff --git a/templates/forms/TextareaField.ss b/templates/forms/TextareaField.ss
index 646e48048..a2a4bf6f6 100644
--- a/templates/forms/TextareaField.ss
+++ b/templates/forms/TextareaField.ss
@@ -1,5 +1,5 @@
<% if isReadonly %>
- <% if Value %>$Value<% else %>(<% _t('NONE', 'none') %>)<% end_if %>
+<% if Value %>$Value<% else %>(<% _t('NONE', 'none') %>)<% end_if %>
<% else %>
-
+
<% end_if %>
\ No newline at end of file
diff --git a/tests/forms/TextareaFieldTest.php b/tests/forms/TextareaFieldTest.php
index fd33c8889..92d68d901 100644
--- a/tests/forms/TextareaFieldTest.php
+++ b/tests/forms/TextareaFieldTest.php
@@ -6,43 +6,21 @@ class TextareaFieldTest extends SapphireTest {
* Quick smoke test to ensure that text is being encoded properly.
*/
function testTextEncoding() {
- $inputText = "This is my
-What's on a new-line?
-These are some unicodes: äöü&<>";
-
+ $inputText = "This is my These are some unicodes: äöü&<>";
$field = new TextareaField("Test", "Test", 5, 20);
$field->setValue($inputText);
-
- $this->assertEquals(<<This is my <text>
-What's on a new-line?
-These are some unicodes: äöü&<>
-HTML
- , $field->Field());
+ $this->assertContains('This is my <text>These are some unicodes: äöü&<>', $field->Field());
}
/**
* Quick smoke test to ensure that text is being encoded properly in readonly fields.
*/
function testReadonlyTextEncoding() {
- $inputText = "This is my
-What's on a new-line?
-These are some unicodes: äöü&<>";
-
+ $inputText = "This is my These are some unicodes: äöü&<>";
$field = new TextareaField("Test", "Test", 5, 20);
$field = $field->performReadonlyTransformation();
-
- // Make sure that the field is smart enough to have its value set after being made readonly
$field->setValue($inputText);
- $this->assertEquals(<<This is my <text>
-What's on a new-line?
-These are some unicodes: äöü&<>
-
-HTML
- , $field->Field());
+ $this->assertContains('This is my <text>These are some unicodes: äöü&<>', $field->Field());
}
}
\ No newline at end of file