Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testGetHTMLFragments() |
||
13 | { |
||
14 | $resource = new Resource(); |
||
15 | $resource->Name = 'Ministry of Silly Walks'; |
||
16 | $resource->ResourceName = 'Face the Press'; |
||
17 | |||
18 | $gridField = new GridField('Test'); |
||
19 | $component = new GridFieldResourceTitle($resource, 'my-target-fragment'); |
||
20 | $result = $component->getHTMLFragments($gridField); |
||
21 | |||
22 | $this->assertNotEmpty( |
||
23 | $result['my-target-fragment'], |
||
24 | 'Should be assigned to the specified fragment' |
||
25 | ); |
||
26 | $this->assertContains( |
||
27 | 'Ministry of Silly Walks | Face the Press', |
||
28 | $result['my-target-fragment'], |
||
29 | 'Should contain title' |
||
30 | ); |
||
31 | $this->assertContains( |
||
32 | 'Edit resource', |
||
33 | $result['my-target-fragment'], |
||
34 | 'Edit button should exist' |
||
35 | ); |
||
38 |