1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
--TEST--
Bug doc-en GH-3353 - incorrect method/function linking when a method's name and a function's name are normalized to the same string
--FILE--
<?php
namespace phpdotnet\phd;
require_once __DIR__ . "/setup.php";
$xmlFile = __DIR__ . "/data/bug_doc-en_GH-3353.xml";
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$render = new Render();
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$config->indexCache = $indexRepository;
// Indexing
$index = new TestIndex($indexRepository, $config, $outputHandler);
$render->attach($index);
$reader = new Reader($outputHandler);
$reader->open($config->xmlFile, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$render->execute($reader);
$render->detach($index);
// Rendering
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render->attach($format);
$reader = new Reader($outputHandler);
$reader->open($config->xmlFile, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$render->execute($reader);
?>
--EXPECT--
Filename: method.and.function.html
Content:
<div id="method.and.function" class="refentry">
<div class="refnamediv">
<h1 class="refname">ClassName::methodName</h1>
<h1 class="refname">classname_methodname</h1>
<p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">ClassName::methodName</span> -- <span class="refname">classname_methodname</span> — <span class="dc-title">1. This is the first method/function description</span></p>
</div>
<div class="refsect1 description" id="method.and.function-description">
<p class="para">
Link to <span class="function"><a href="method.only.html" class="function">ClassName::methodName()</a></span> with a function tag
and to <span class="function"><a href="function.only.html" class="function">classname_methodname()</a></span> with a function tag
and to <span class="methodname"><a href="method.only.html" class="methodname">ClassName::methodName()</a></span> with a methodname tag
and to <span class="methodname"><a href="function.only.html" class="methodname">classname_methodname()</a></span> with a methodname tag
</p>
</div>
</div>
Filename: method.only.html
Content:
<div id="method.only" class="refentry">
<div class="refnamediv">
<h1 class="refname">ClassName::methodName</h1>
<p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">ClassName::methodName</span> — <span class="dc-title">2. This is the second (method) description</span></p>
</div>
<div class="refsect1 description" id="method.only-description">
<p class="para">
Link to <span class="function"><strong>ClassName::methodName()</strong></span> with a function tag
and to <span class="function"><a href="function.only.html" class="function">classname_methodname()</a></span> with a function tag
and to <span class="methodname"><strong>ClassName::methodName()</strong></span> with a methodname tag
and to <span class="methodname"><a href="function.only.html" class="methodname">classname_methodname()</a></span> with a methodname tag
</p>
</div>
</div>
Filename: function.only.html
Content:
<div id="function.only" class="refentry">
<div class="refnamediv">
<h1 class="refname">classname_methodname</h1>
<p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">classname_methodname</span> — <span class="dc-title">3. This is the third (function) description</span></p>
</div>
<div class="refsect1 description" id="function.only-description">
<p class="para">
Link to <span class="function"><a href="method.only.html" class="function">ClassName::methodName()</a></span> with a function tag
and to <span class="function"><strong>classname_methodname()</strong></span> with a function tag
and to <span class="methodname"><a href="method.only.html" class="methodname">ClassName::methodName()</a></span> with a methodname tag
and to <span class="methodname"><strong>classname_methodname()</strong></span> with a methodname tag
</p>
</div>
</div>
Filename: function.only.html
Content:
<div id="bug_doc-en_GH-3353" class="refentry">
</div>
|