'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);
$table = $this->parser->parseStr($output)->query('table');
assert($table instanceof \pQuery);
$paragraph_table = $table[0]->toString();
$expected_result = '';
expect($paragraph_table)->equals($expected_result);
}
function testItRendersList() {
$this->block['text'] = '';
$output = Text::render($this->block);
$ul = $this->parser->parseStr($output)->query('ul');
assert($ul instanceof \pQuery);
$list = $ul[0]->toString();
$expected_result = '';
expect($list)->equals($expected_result);
}
function testItRendersBlockquotes() {
$this->block['text'] = 'Quote
';
$output = Text::render($this->block);
$table = $this->parser->parseStr($output)->query('table');
assert($table instanceof \pQuery);
$blockquote_table = $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('
');
}
}