'text',
'text' => 'Text',
];
/** @var pQuery */
private $parser;
function _before() {
parent::_before();
$this->parser = new pQuery;
}
function testItRendersPlainText() {
$output = Text::render($this->block);
$expected_result = '
Text
|
';
expect($output)->equals($expected_result);
}
function testItRendersParagraph() {
$this->block['text'] = 'Text
';
$output = Text::render($this->block);
$paragraph_table = $this->parser->parseStr($output)->query('table')[0]->toString();
$expected_result = '';
expect($paragraph_table)->equals($expected_result);
}
function testItRendersList() {
$this->block['text'] = '';
$output = Text::render($this->block);
$list = $this->parser->parseStr($output)->query('ul')[0]->toString();
$expected_result = '';
expect($list)->equals($expected_result);
}
function testItRendersBlockquotes() {
$this->block['text'] = 'Quote
';
$output = Text::render($this->block);
$blockquote_table = $this->parser->parseStr($output)->query('table')[0]->toString();
$expected_result = '';
expect($blockquote_table)->equals($expected_result);
}
function testItStylesHeadings() {
$this->block['text'] = 'Heading
Heading 2
';
$output = Text::render($this->block);
expect($output)->contains('Heading
');
expect($output)->contains('Heading 2
');
}
function testItRemovesLastLineBreak() {
$this->block['text'] = 'hello
';
$output = Text::render($this->block);
expect($output)->notContains('
');
}
}