public function asText($value) { if ($value === null) { return $this->nullDisplay; } return Html::encode($value); }
public function testAsText() { $value = '123'; $this->assertSame($value, $this->formatter->asText($value)); $value = 123; $this->assertSame("{$value}", $this->formatter->asText($value)); $value = '<>'; $this->assertSame('<>', $this->formatter->asText($value)); // null display $this->assertSame($this->formatter->nullDisplay, $this->formatter->asText(null)); }