Total Complexity | 3 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class ShortURLTest extends SapphireTest |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected static $fixture_file = [ |
||
16 | '../fixtures.yml', |
||
17 | ]; |
||
18 | |||
19 | /** |
||
20 | * |
||
21 | */ |
||
22 | public function testGetCMSFields() |
||
23 | { |
||
24 | $object = $this->objFromFixture(ShortURL::class, 'one'); |
||
25 | $fields = $object->getCMSFields(); |
||
26 | $this->assertInstanceOf(FieldList::class, $fields); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * |
||
31 | */ |
||
32 | public function testGetValidate() |
||
33 | { |
||
34 | $object = $this->objFromFixture(ShortURL::class, 'one'); |
||
35 | $object->Title = ''; |
||
36 | $this->expectException(ValidationException::class); |
||
37 | $object->write(); |
||
38 | |||
39 | $this->objFromFixture(ShortURL::class, 'one'); |
||
40 | $object->URL = ''; |
||
41 | $this->expectException(ValidationException::class); |
||
42 | $object->write(); |
||
43 | |||
44 | $this->objFromFixture(ShortURL::class, 'one'); |
||
45 | $object->CampaignSource = ''; |
||
46 | $this->expectException(ValidationException::class); |
||
47 | $object->write(); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | */ |
||
53 | public function testGetLongURL() |
||
58 | } |
||
59 | } |
||
60 |