Skip to content

Commit

Permalink
Issue #1250, associated unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris--S committed May 16, 2018
1 parent b8f4772 commit 2ef8deb
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions _test/tests/inc/parser/renderer_metadata.test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

/**
* Class renderer_xhtml_test
*/
class renderer_metadata_test extends DokuWikiTest {
/** @var Doku_Renderer_xhtml */
protected $R;

/**
* Called for each test
*
* @throws Exception
*/
function setUp() {
parent::setUp();
$this->R = new Doku_Renderer_metadata();
}

function tearDown() {
unset($this->R);
}


function test_footnote_and_abstract() {
// avoid issues with the filectime() & filemtime in document_start() & document_end()
$now = time();
$this->R->persistent['date']['created'] = $now;
$this->R->persistent['date']['modified'] = $now;

$this->R->document_start();

$this->R->cdata("abstract: ");

$this->R->footnote_open();
$this->R->cdata(str_pad("footnote: ", Doku_Renderer_metadata::ABSTRACT_MAX, "lotsa junk "));
$this->R->footnote_close();

$this->R->cdata("abstract end.");

$this->R->document_end();

$expected = 'abstract: abstract end.';
$this->assertEquals($expected, $this->R->meta['description']['abstract']);
}

}

0 comments on commit 2ef8deb

Please sign in to comment.