mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
27 lines
909 B
PHP
27 lines
909 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());
|
|
}
|
|
|
|
}
|