2017-01-11 02:35:45 -05:00
|
|
|
<?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()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 07:37:21 -05:00
|
|
|
public function testTextIsRenderedAsGivenWhenDeclaredBeingEscaped()
|
|
|
|
|
{
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
'A & O',
|
|
|
|
|
Text::create('A & O')->setEscaped()->render()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
'A & O',
|
|
|
|
|
Text::create('A & O')->setEscaped(true)->render()
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
'A & O',
|
|
|
|
|
Text::create('A & O')->setEscaped(false)->render()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 02:35:45 -05:00
|
|
|
public function testTextIsEscapedWhenRendered()
|
|
|
|
|
{
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
'A & O',
|
|
|
|
|
Text::create('A & O')->render()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|