test/php: simple new tests

This commit is contained in:
Thomas Gelf 2017-01-11 08:35:45 +01:00
parent 024618e3a5
commit 4c01909cf8
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<?php
namespace Tests\Icinga\Module\Businessprocess\Html;
use Icinga\Module\Businessprocess\Html\HtmlTag;
use Icinga\Module\Businessprocess\Test\BaseTestCase;
class HtmlTagTest extends BaseTestCase
{
public function testH1isRendered()
{
$h1 = HtmlTag::h1('Hea & der');
$this->assertEquals(
$h1->render(),
'<h1>Hea &amp; der</h1>'
);
}
}

View file

@ -0,0 +1,25 @@
<?php
namespace Tests\Icinga\Module\Businessprocess\Html;
use Icinga\Module\Businessprocess\Html\Text;
use Icinga\Module\Businessprocess\Test\BaseTestCase;
class TextTest extends BaseTestCase
{
public function testTextIsReturnedAsGiven()
{
$this->assertEquals(
'A & O',
Text::create('A & O')->getText()
);
}
public function testTextIsEscapedWhenRendered()
{
$this->assertEquals(
'A &amp; O',
Text::create('A & O')->render()
);
}
}