Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2390 from splitbrain/footnote_metafix
Fix for Issue#1250 Footnotes break metadata abstract saving
- Loading branch information
Showing
2 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters