mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.5' into 3.5.1
This commit is contained in:
commit
2d8ac831ad
@ -293,6 +293,7 @@ class PaginatedList extends SS_ListDecorator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$left = max($current - $offset, 1);
|
$left = max($current - $offset, 1);
|
||||||
|
$right = min($current + $offset, $total);
|
||||||
$range = range($current - $offset, $current + $offset);
|
$range = range($current - $offset, $current + $offset);
|
||||||
|
|
||||||
if ($left + $context > $total) {
|
if ($left + $context > $total) {
|
||||||
@ -304,7 +305,7 @@ class PaginatedList extends SS_ListDecorator {
|
|||||||
$num = $i + 1;
|
$num = $i + 1;
|
||||||
|
|
||||||
$emptyRange = $num != 1 && $num != $total && (
|
$emptyRange = $num != 1 && $num != $total && (
|
||||||
$num == $left - 1 || $num == $left + $context + 1
|
$num == $left - 1 || $num == $right + 1
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($emptyRange) {
|
if ($emptyRange) {
|
||||||
|
@ -15,6 +15,20 @@ class HtmlEditorFieldTest extends FunctionalTest {
|
|||||||
|
|
||||||
protected $extraDataObjects = array('HtmlEditorFieldTest_Object');
|
protected $extraDataObjects = array('HtmlEditorFieldTest_Object');
|
||||||
|
|
||||||
|
public function testCasting() {
|
||||||
|
// Test special characters
|
||||||
|
$inputText = "These are some unicodes: ä, ö, & ü";
|
||||||
|
$field = new HTMLEditorField("Test", "Test");
|
||||||
|
$field->setValue($inputText);
|
||||||
|
$this->assertContains('These are some unicodes: ä, ö, & ü', $field->Field());
|
||||||
|
|
||||||
|
// Test shortcodes
|
||||||
|
$inputText = "Shortcode: [file_link id=4]";
|
||||||
|
$field = new HTMLEditorField("Test", "Test");
|
||||||
|
$field->setValue($inputText);
|
||||||
|
$this->assertContains('Shortcode: [file_link id=4]', $field->Field());
|
||||||
|
}
|
||||||
|
|
||||||
public function testBasicSaving() {
|
public function testBasicSaving() {
|
||||||
$obj = new HtmlEditorFieldTest_Object();
|
$obj = new HtmlEditorFieldTest_Object();
|
||||||
$editor = new HtmlEditorField('Content');
|
$editor = new HtmlEditorField('Content');
|
||||||
|
@ -2,6 +2,20 @@
|
|||||||
|
|
||||||
class TextareaFieldTest extends SapphireTest {
|
class TextareaFieldTest extends SapphireTest {
|
||||||
|
|
||||||
|
public function testCasting() {
|
||||||
|
// Test special characters
|
||||||
|
$inputText = "These are some unicodes: ä, ö, & ü";
|
||||||
|
$field = new TextareaField("Test", "Test");
|
||||||
|
$field->setValue($inputText);
|
||||||
|
$this->assertContains('These are some unicodes: ä, ö, & ü', $field->Field());
|
||||||
|
|
||||||
|
// Test shortcodes
|
||||||
|
$inputText = "Shortcode: [file_link id=4]";
|
||||||
|
$field = new TextareaField("Test", "Test");
|
||||||
|
$field->setValue($inputText);
|
||||||
|
$this->assertContains('Shortcode: [file_link id=4]', $field->Field());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quick smoke test to ensure that text with unicodes is being displayed properly in readonly fields.
|
* Quick smoke test to ensure that text with unicodes is being displayed properly in readonly fields.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user