mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 21:15:40 +02:00
26 lines
908 B
PHP
26 lines
908 B
PHP
<?php
|
|
|
|
class TextareaFieldTest extends SapphireTest {
|
|
|
|
/**
|
|
* Quick smoke test to ensure that text is being encoded properly.
|
|
*/
|
|
function testTextEncoding() {
|
|
$inputText = "This is my <text>These are some unicodes: äöü&<>";
|
|
$field = new TextareaField("Test", "Test");
|
|
$field->setValue($inputText);
|
|
$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 <text>These are some unicodes: äöü&<>";
|
|
$field = new TextareaField("Test", "Test");
|
|
$field = $field->performReadonlyTransformation();
|
|
$field->setValue($inputText);
|
|
$this->assertContains('This is my <text>These are some unicodes: äöü&<>', $field->Field());
|
|
}
|
|
|
|
} |