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