GridFieldLinkButtonTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCorrectLinkIsContained() 0 6 1
1
<?php
2
3
namespace BringYourOwnIdeas\Maintenance\Tests\Forms;
4
5
use BringYourOwnIdeas\Maintenance\Forms\GridFieldLinkButton;
6
use SilverStripe\Dev\SapphireTest;
7
8
class GridFieldLinkButtonTest extends SapphireTest
9
{
10
    /**
11
     * Not very strong test, as it relies on template output.
12
     */
13
    public function testCorrectLinkIsContained()
14
    {
15
        $button = new GridFieldLinkButton('https://addons.silverstripe.org', 'Explore Addons', 'test');
16
        $output = $button->getHTMLFragments(null);
17
18
        $this->assertStringContainsString('https://addons.silverstripe.org', $output['test']);
19
    }
20
}
21