2009-06-17 13:36:49 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class TextareaFieldTest extends SapphireTest {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Quick smoke test to ensure that text is being encoded properly.
|
|
|
|
*/
|
|
|
|
function testTextEncoding() {
|
2011-03-24 05:45:01 +01:00
|
|
|
$inputText = "This is my <text>These are some unicodes: äöü&<>";
|
2012-01-10 04:58:27 +01:00
|
|
|
$field = new TextareaField("Test", "Test");
|
2009-06-17 13:36:49 +02:00
|
|
|
$field->setValue($inputText);
|
2011-03-24 05:45:01 +01:00
|
|
|
$this->assertContains('This is my <text>These are some unicodes: äöü&<>', $field->Field());
|
2009-06-17 13:36:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Quick smoke test to ensure that text is being encoded properly in readonly fields.
|
|
|
|
*/
|
|
|
|
function testReadonlyTextEncoding() {
|
2011-03-24 05:45:01 +01:00
|
|
|
$inputText = "This is my <text>These are some unicodes: äöü&<>";
|
2012-01-10 04:58:27 +01:00
|
|
|
$field = new TextareaField("Test", "Test");
|
2009-06-17 13:36:49 +02:00
|
|
|
$field = $field->performReadonlyTransformation();
|
|
|
|
$field->setValue($inputText);
|
2011-03-24 05:45:01 +01:00
|
|
|
$this->assertContains('This is my <text>These are some unicodes: äöü&<>', $field->Field());
|
2009-06-17 13:36:49 +02:00
|
|
|
}
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|