-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: haszi <haszika80@gmail.com>
- Loading branch information
Showing
3 changed files
with
150 additions
and
0 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
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<chapter xml:id="property_linking" xmlns="http://docbook.org/ns/docbook"> | ||
|
||
<section> | ||
<para>1. Existing property</para> | ||
<para> | ||
<property>Vendor\Namespace::$definitely_exists</property> | ||
</para> | ||
<para> | ||
<property>Vendor\Namespace::$definitelyExists2</property> | ||
</para> | ||
</section> | ||
|
||
<section> | ||
<para>2. Nonexistent properties</para> | ||
<para> | ||
<property>Vendor\Namespace::$this_does_not_exist</property> | ||
</para> | ||
<para> | ||
<property>Vendor\Namespace::$thisDoesNotExist2</property> | ||
</para> | ||
</section> | ||
|
||
<section> | ||
<para>3. Properties with leading and trailing underscores in ID</para> | ||
<para> | ||
<property>Extension\Class::$__leading_and_trailing_undescores__</property> | ||
</para> | ||
<para> | ||
<property>Extension\Class::$__leadingAndTrailingUndescores2__</property> | ||
</para> | ||
</section> | ||
|
||
</chapter> |
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,89 @@ | ||
--TEST-- | ||
Property linking 001 | ||
--FILE-- | ||
<?php | ||
namespace phpdotnet\phd; | ||
|
||
require_once __DIR__ . "/../../setup.php"; | ||
|
||
$xml_file = __DIR__ . "/data/property_linking.xml"; | ||
|
||
$config->setXml_file($xml_file); | ||
|
||
$indices = [ | ||
[ | ||
"docbook_id" => "vendor-namespace.props.definitely-exists", | ||
"filename" => "extensionname.page", | ||
], | ||
[ | ||
"docbook_id" => "vendor-namespace.props.definitelyexists2", | ||
"filename" => "extensionname.page", | ||
], | ||
[ | ||
"docbook_id" => "extension-class.props.leading-and-trailing-undescores", | ||
"filename" => "extensionname2.page2", | ||
], | ||
[ | ||
"docbook_id" => "extension-class.props.leadingandtrailingundescores2", | ||
"filename" => "extensionname2.page2", | ||
], | ||
]; | ||
|
||
$format = new TestPHPChunkedXHTML($config, $outputHandler); | ||
|
||
foreach ($indices as $index) { | ||
$format->SQLiteIndex( | ||
null, // $context, | ||
null, // $index, | ||
$index["docbook_id"] ?? "", // $id, | ||
$index["filename"] ?? "", // $filename, | ||
$index["parent_id"] ?? "", // $parent, | ||
$index["sdesc"] ?? "", // $sdesc, | ||
$index["ldesc"] ?? "", // $ldesc, | ||
$index["element"] ?? "", // $element, | ||
$index["previous"] ?? "", // $previous, | ||
$index["next"] ?? "", // $next, | ||
$index["chunk"] ?? 0, // $chunk | ||
); | ||
} | ||
|
||
$render = new TestRender(new Reader($outputHandler), $config, $format); | ||
|
||
$render->run(); | ||
?> | ||
--EXPECTF-- | ||
Filename: property_linking.html | ||
Content: | ||
<div id="property_linking" class="chapter"> | ||
|
||
<div class="section"> | ||
<p class="para">%d. Existing property</p> | ||
<p class="para"> | ||
<span class="property"><a href="extensionname.page.html#vendor-namespace.props.definitely-exists">Vendor\Namespace::$definitely_exists</a></span> | ||
</p> | ||
<p class="para"> | ||
<span class="property"><a href="extensionname.page.html#vendor-namespace.props.definitelyexists2">Vendor\Namespace::$definitelyExists2</a></span> | ||
</p> | ||
</div> | ||
|
||
<div class="section"> | ||
<p class="para">%d. Nonexistent properties</p> | ||
<p class="para"> | ||
<span class="property">Vendor\Namespace::$this_does_not_exist</span> | ||
</p> | ||
<p class="para"> | ||
<span class="property">Vendor\Namespace::$thisDoesNotExist2</span> | ||
</p> | ||
</div> | ||
|
||
<div class="section"> | ||
<p class="para">%d. Properties with leading and trailing underscores in ID</p> | ||
<p class="para"> | ||
<span class="property"><a href="extensionname2.page2.html#extension-class.props.leading-and-trailing-undescores">Extension\Class::$__leading_and_trailing_undescores__</a></span> | ||
</p> | ||
<p class="para"> | ||
<span class="property"><a href="extensionname2.page2.html#extension-class.props.leadingandtrailingundescores2">Extension\Class::$__leadingAndTrailingUndescores2__</a></span> | ||
</p> | ||
</div> | ||
|
||
</div> |