mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-10 09:17:39 +01:00
* Made sure most helpers are independent of Yii::$app * Made sure most validators are independent of Yii::$app
40 lines
917 B
PHP
40 lines
917 B
PHP
<?php
|
|
|
|
namespace yiiunit\framework\helpers;
|
|
|
|
use yiiunit\TestCase;
|
|
use yii\helpers\Markdown;
|
|
/**
|
|
* Description of MarkdownTest
|
|
*
|
|
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
|
|
* @group helpers
|
|
*/
|
|
class MarkdownTest extends TestCase
|
|
{
|
|
protected function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
// destroy application, Helper must work without Yii::$app
|
|
$this->destroyApplication();
|
|
}
|
|
|
|
public function testOriginalFlavor()
|
|
{
|
|
$text = <<<TEXT
|
|
html
|
|
new line 1
|
|
|
|
new line 2
|
|
TEXT;
|
|
|
|
Markdown::$defaultFlavor = 'original';
|
|
$this->assertEquals(Markdown::process($text), Markdown::process($text, 'original'));
|
|
|
|
Markdown::$defaultFlavor = 'gfm-comment';
|
|
$this->assertNotEquals(Markdown::process($text), Markdown::process($text, 'original'));
|
|
$this->assertEquals(Markdown::process($text), Markdown::process($text, 'gfm-comment'));
|
|
}
|
|
}
|