Completed
Push — master ( 3da775...1e6bd3 )
by Robbie
9s
created

GridFieldLinkButtonTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 13
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->assertContains('https://addons.silverstripe.org', $output['test']);
19
    }
20
}
21