Test Setup Failed
Push — master ( 210134...c17796 )
by Damian
03:18
created

tests/php/View/ViewableDataTest/Castable.php (2 issues)

Severity
1
<?php
2
3
namespace SilverStripe\View\Tests\ViewableDataTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\View\ViewableData;
7
8
class Castable extends ViewableData implements TestOnly
9
{
10
11
    private static $default_cast = Caster::class;
0 ignored issues
show
The private property $default_cast is not used, and could be removed.
Loading history...
12
13
    private static $casting = array(
0 ignored issues
show
The private property $casting is not used, and could be removed.
Loading history...
14
        'alwaysCasted' => RequiresCasting::class,
15
        'castedUnsafeXML' => UnescapedCaster::class,
16
        'test' => 'Text',
17
    );
18
19
    public $test = 'test';
20
21
    public $uncastedZeroValue = 0;
22
23
    public function alwaysCasted()
24
    {
25
        return 'alwaysCasted';
26
    }
27
28
    public function noCastingInformation()
29
    {
30
        return 'noCastingInformation';
31
    }
32
33
    public function unsafeXML()
34
    {
35
        return '<foo>';
36
    }
37
38
    public function castedUnsafeXML()
39
    {
40
        return $this->unsafeXML();
41
    }
42
43
    public function forTemplate()
44
    {
45
        return 'castable';
46
    }
47
}
48