mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 16:49:34 -05:00
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Icinga\Module\Businessprocess\Html;
|
|
|
|
use Icinga\Module\Businessprocess\Html\Link;
|
|
use Icinga\Module\Businessprocess\Test\BaseTestCase;
|
|
|
|
class LinkTest extends BaseTestCase
|
|
{
|
|
public function testContentFromFactoryIsRendered()
|
|
{
|
|
$l = Link::create('Click here', 'go/some/where');
|
|
$this->assertEquals(
|
|
'Click here',
|
|
$l->renderContent()
|
|
);
|
|
}
|
|
|
|
public function testSimpleLinkRendersCorrectly()
|
|
{
|
|
$l = Link::create('Click here', 'go/some/where');
|
|
$this->assertEquals(
|
|
'<a href="/icingaweb2/go/some/where">Click here</a>',
|
|
$l->render()
|
|
);
|
|
}
|
|
|
|
public function testLinkWithParamsRendersCorrectly()
|
|
{
|
|
$l = Link::create(
|
|
'Click here',
|
|
'go/some/where',
|
|
array(
|
|
'with' => 'me',
|
|
'and' => 'aDog'
|
|
)
|
|
);
|
|
$this->assertEquals(
|
|
'<a href="/icingaweb2/go/some/where?with=me&and=aDog">Click here</a>',
|
|
$l->render()
|
|
);
|
|
}
|
|
}
|