testCorrectLinkIsContained()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
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